Artjom Posted June 16, 2010 Report Share 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 Link to comment Share on other sites More sharing options...
Guest lorathon Posted June 16, 2010 Report Share 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 Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 17, 2010 Administrators Report Share Posted June 17, 2010 You can also use number_format Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted June 17, 2010 Report Share Posted June 17, 2010 You can also use number_format Yeah, Thats even a better way. I knew that I was forgetting something. Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 17, 2010 Author Report Share 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 Link to comment Share on other sites More sharing options...
Artjom Posted July 4, 2010 Author Report Share Posted July 4, 2010 Code: added in PilotData.class.php '.number_format($pilot->totalpay, 2, ',', ' '). '$';Â Quote Link to comment Share on other sites More sharing options...
Edwin Posted May 30, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
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.