Simple math:
$a=$b/$c; echo $a;
if $ b is 123.00 and $ c is 1, then $ a becomes 123.
If $ b is 123.50, $ c is 1, $ a is 123.50. But in the first case, I want $ a to be 123.00.
You can check whether $ a has any nonzero fraction or not, and then add trailing zeros if necessary.
But I'm looking for php functions to do the same. Is it possible?
EDIT:
What if i don't need commas from number_format ?
php
Isstiaque ahmed
source share