Arbitrary precision number formatting / money_format?

ssdeeper

New Member
Is there an arbitrary-precision alternative to money_format available that could take a string instead of a float as a parameter? It's not that I plan on doing calculations on trillions of monetary units, but after going through the trouble to properly handle monetary arithmetic without abusing floats, it'd be nice to have a function that doesn't spew random numbers after about 15 digits, even if users decide to give it nonsense data. Or, hey, maybe someone wants to buy two sticks of gum in Zimbabwe dollars?I hesitate to use regular expressions because I was hoping to make use of the localization of money_format.edit - found a workable solution; see below
 
Back
Top