KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm working on a few report output scripts that need to do some rudimentary calculations on some money values. I am aware of the limitations of floating point arithmetic for this purpose, however the input values are all in a decimal format, so if I use the arithmetic operators on them PHP will cast them to floats. So what is the best way to handle the numbers? Should I use BCMath ? Is there something akin to Decimal in .NET? Or is it safe to use the arithmetic operators if I cast back to int?
Tags (comma-separated)
Save Edits
Cancel