I made a calculator and i use number format to fix the numbers so its understandable. The problem is that when it reached more then 8,000 to & by 60% it is using the 8 and not the 8,000 so its giveing the wrong answer its giveing $12.80 instead of $12,800 is there a way to fix this. I can provide a url to my site if you need to see it. i have the number format wrote like this <?php echo number_format("$var","2",".",",") ; ?>
Convert your number format from 8,000 to 8000 when you do any calculations. Number with '.' in PHP indicate fractional number. There is no number in PHP with ',' - it is only understandable variant for us. That's why, you number must be with out any '.' or ',' separators. Easy step to convert is to use str_replace(',','',$var).