always do a pre-check to see if the variable contains only a zero, then either make 2 decimal places, (as this may prevent it fitting into the field space given, or round the number after.
This will make it two decimal places
1 2 3 4 5 |
if ($myconversions == 0 ) { $databasevar= sprintf("%1.2f",$databasevar); } |