Php对钱的计算精度为0.01美分

I'm building a platform in PHP for a client that requires calculations, in particular division, to be done on money. These calculations need to be done to an accuracy of .01 cent. Is the correct way to multiple the currency by 10000 and cast to an INT, then do calcultions on this number?

I suggest do all your calculations in the correct/actual floating numbers (Don't CAST or convert them) and you can just format it later with 2 decimal precisions.

Use number_format or round for displaying results only.