note 7327 deleted from Floating point numbers by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 08 Sep 2000 02:04:25 +0000 |
| Subject: | note 7327 deleted from Floating point numbers by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4466@lists.php.net to get a copy of this message | ||
Dear all,<br>
I try to add two double number (which from mysql) and want to display the decmial point even it is
zero, like that:<br>
$pt1 = doubleval($col1);<br>
$pt2 = doubleval($col2);<br>
$pt3 = $pt1+$pt2; <br>
/*display xx.xx when $pt1=aa.aa or $pt2=aa.aa*/<br>
/* when $pt1=aa and $pt2=bb, $pt3=xx rather than xx.00 */<br>
Is that had any easy way to add zero's to the end? (although can use strlen to check the length
and add zero, but seem must had a good method). <br>
Thx a lot.