Moneymath with added precision support
tschallacka opened this issue · comments
Hey, I thought your Decimal2 is fantastic, but for database decimal with precicion to float conversion was less then accurate.
So i took what is yours, modified it to support precicion.
Hope you like it. Please have a look see and possibly upload it too to your github. I did not modify everything, just the calculation of numbers behind the .
Thanks for the great code.
Hi @tschallacka
Thanks! However, I don't think I should merge that. You see, MoneyMath\Decimal2
is solving a different problem. It's not intended to be a universal decimal ADT with arbitrarily limited precision. As the namespace suggests, it only targets the money amounts, rounding to a cent. For general-purpose arbitrary precise decimals you'd need a different solution.
Of course, you're welcome re-purpose the MIT-licensed code in any way you find useful. I'm glad I could give you a foundation.