I need to format a decimal like this:
00.33
11.24
05.22
The problem is that when I retrieve 00.33
it outputs as 0.33
.
I tried everything and can't get it to work correctly. I could do MySQL's Zerofill
but I'm really trying to avoid that.
sprintf("%05.2f", 0.33)
# or
"%05.2f" % 0.33
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With