coupe-r Posted June 16, 2010 Share Posted June 16, 2010 Hello All, I have 2 vars that echo the following: $current_rate = 585.00 $amount_paid = 584.99 These are both accurate and pulled from the DB. When I do this: $balance = $current_rate - $amount_paid Which is 585.00-584.99 The var $balance now equals 0.0099999999999909. How can that be? Link to comment https://forums.phpfreaks.com/topic/204993-weird-php-output-please-help/ Share on other sites More sharing options...
coupe-r Posted June 16, 2010 Author Share Posted June 16, 2010 I fixed it with $balance = round($balance, 2); Will this cause any issues? Link to comment https://forums.phpfreaks.com/topic/204993-weird-php-output-please-help/#findComment-1073179 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.