Join GitHub today
Avoid floats when creating an Euro from string #6
gbirke left a comment
I like this code a lot, because it sidesteps the float conversion.
while reading the code, I struggled a bit to understand what it does, esp. the padding and rounding parts. After I understood it, it was easy and clear, but maybe, for speeding up the understanding of future developers you can add some comments or split it into more functions?
Also, the "2" smells of a magic number. I think the code will become more clear, if we call it something like