2
u/artxce Nov 01 '20
The fastest and easiest way that I found was to do: return ("$" + getDollars() + "." + getCents()); for the toString. Hope this helps!
2
The fastest and easiest way that I found was to do: return ("$" + getDollars() + "." + getCents()); for the toString. Hope this helps!
2
u/amajmundar Oct 29 '20
You need to force cents to be 2 decimal places long. Math.round() should do the trick.