I can't seem to find a way to return
a number
as 0.50 not 0.5
I found various solutions to display always 2 digits but all of them work only if the number ends in something other than 0 e.g. 0.05 works fine, but 0.20 will always be returned as 0.2
Again, I need typeof(number)
to be number
NOT string
.
I am trying to solve this: freecodecamp.org/challenges/exact-change and I need to return [["TWENTY", 60.00], ["TEN", 20.00], ["FIVE", 15.00], ["ONE", 1.00], ["QUARTER", 0.50], ["DIME", 0.20], ["PENNY", 0.04]] -- if I return for example ["QUARTER", "0.50"] it will not pass