RE: [PHP] Rounding to strange results
| From: | Rick St Jean | Date: | Tue, 06 Mar 2001 16:04:23 +0000 |
| Subject: | RE: [PHP] Rounding to strange results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42761@lists.php.net to get a copy of this message | ||
You can write a function that get the %(mod) of 1000 then subtracts it from the number.
Rick
At 08:43 AM 3/6/01 -0700, Johnson, Kirk wrote:
Is there a comma in one thousand, e.g., 1,000.00? round() will truncate everything to the right of a comma. Kirk -----Original Message----- From: Martin E. Koss [mailto:mek@mek.co.uk] Sent: Tuesday, March 06, 2001 7:45 AM To: php-general@lists.php.net Subject: [PHP] Rounding to strange results Hi, I use a product database for 2 sites, one of which adds sales tax and rounds to the nearest .10 and on the other site there is no tax and also no rounding. I am unable to figure out why a price of 1000.00 is being displayed as 1.00 and any price over 1000 does the same thing. 100.00 works fine, as does all other prices, this is the same with and without rounding. Anything I should look for to solve this problem? Martin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net########################################################## # Rick St Jean, # rstjean@internet.look.ca # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################