Cash Register test, GREAT HINT!

Working with decimal numbers you can have problems, because javascript goes crazy with them, the best thing you could do from the beginning is multiply everything by 100, so javascript will not throw you unwanted decimals, that’s how I was able to pass the test , good luck.

:laughing: keep it up, it is really helpful, although solved that challenge, I might redo it

1 Like

Thanks for your comment, you could do it again if you want, it is a challenge for those of us who haven’t been programming much. :grin:

1 Like

even after multiplying by 100, it did not work, I used parseFloat(change.toFixed(2)) to work it out. cheers! :smiley:

That’s what I do too lol

If you multiply by 100, you have to convert the numbers to integers.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.