How would I convert a float into its 'accounting form' --
100028282.23 --> 100,028,282.23
100028282 --> 100,028,282.00
Is there a python method that does this?
As an alternative to beerbajay's excellent answer, simple string formatting works in 2.7+, without requiring an import:
>>> '{0:,.2f}'.format(24322.34)
'24,322.34'
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