Build a Cash Register Project - Build a Cash Register

Tell us what’s happening:

I am having trouble where I am off by 1 cent and having poential infinite while loop errors. I’ve been stuck and can’t seem to figure out a solution

Your code so far

<!-- file: index.html -->

/* file: script.js */

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Build a Cash Register Project - Build a Cash Register

Without seeing your code it’s hard to say something certain. From what you wrote it seems you might be affected by floating point error. Floating point numbers cannot be accurately represented in computers. This makes mathematical operations on them inaccurate, one explicit example of it is: 0.1 + 0.1 + 0.1 !== 0.3

Hey there,

Please update the message to include your code. The code was too long to be automatically inserted by the help button.

When you enter a code, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Hello, sorry for forgetting to put the code. But I was able to figure it out by converting metrics into cents. Then doing the math.