Artjom Posted June 16, 2010 Report Posted June 16, 2010 Hello all, problem with the calculation of money after the decimal point a lot of numbers, an example 63.3333 (see photo), how to do that was not 63.3333, but only two digits after the decimal point, example 63.33 thanks in advance for your help! Regards Artjom Quote
Guest lorathon Posted June 16, 2010 Report Posted June 16, 2010 I am not sure of the variable but something like this should work round($moneyVariable, 2) This would round the $moneyVariable to 2 places after the decimal Quote
Administrators Nabeel Posted June 17, 2010 Administrators Report Posted June 17, 2010 You can also use number_format Quote
Guest lorathon Posted June 17, 2010 Report Posted June 17, 2010 You can also use number_format Yeah, Thats even a better way. I knew that I was forgetting something. Quote
Artjom Posted June 17, 2010 Author Report Posted June 17, 2010 Yes thanks for replays, but I don't know who can i add this code into PilotData.class.php: number_format($number, 2, '.', ''); Quote
Artjom Posted July 4, 2010 Author Report Posted July 4, 2010 Code: added in PilotData.class.php '.number_format($pilot->totalpay, 2, ',', ' '). '$';Â Quote
Edwin Posted May 30, 2012 Report Posted May 30, 2012 I have found out i have the same issue on all items where i want to show the earnings, any way i can change it that the table only creates the 2 decimals behind the comma? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.