re: Daily Challenge #49 - Dollars and Cents VIEW POST

TOP OF THREAD FULL DISCUSSION
re: const formatDollars = money => `$${money.toFixed(2)}`; ` love js
 

Mind rounding "errors":

formatDollars(.126)
> '$0.13'

Same happens in python:

print(f"{123.126:.2f}")
123.13
 

It rounded up, though, so is that an error? It seems like expected behavior to me.

code of conduct - report abuse