css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

Functional animated calculator with script heavily modified from @supah's pen.

Comments

  1. This doesn't work! (but it looks nice)

  2. @sburkebuzz Thanks! Which part isn't working? It seems to be working from my end!

  3. 5X5 enter (25)

    +1 enter (26)

    -4 enter (22)

    x 99 enter (-370) ??

    Just a bug :)

  4. @sburkebuzz That makes sense! It's doing the entire equation in PEMDAS order instead of taking the previous total - 5×5+1-(4×99) instead of (5×5+1-4)×99. Thanks for the catch!

  5. Chris @Chris_Scomersi on

    0/0 collapses it :) you should catch the infinity value and replace it with 0 something like
    if output == Infinity || isNaN(output)) {
    output = "error"; // or output = 0
    }

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.
Loading...
Loading...