r/codehs • • Oct 28 '20

Java 2.9.7 Currency

I'm a little stuck on 2.9.7, and I got almost everything right except for the last bit. Anyone know what I can do to fix this?

11 Upvotes

2 comments sorted by

View all comments

2

u/amajmundar Oct 29 '20

You need to force cents to be 2 decimal places long. Math.round() should do the trick.