Re: Preserving Decimals

From: Date: Fri, 16 Jun 2000 21:13:48 +0000
Subject: Re: Preserving Decimals
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2116@lists.php.net to get a copy of this message
I'd guess that you could just do a check to see if it is a whole number. If it is, just print ".00" on the end. It messy but it should work. Adam At 16:03 16-06-00 -0500, you wrote:
Hello, PHP seems to do a funny thing when it adds empty decimals.. it makes them disappear. So if I were to add 5.00 to 4.00 it would display 9, not 9.00 Or if I were to add 4.50 to 3.00 it would display 8.5 not 8.50 I have looked through the archives and my book for a solution to this problem, since I thought it should be quiet common. After all PHP is used in many commerce sites. So what is the simplest way to preserve decimals in a variable? Best Regards, Yoed P.S. please reply directly to me as well as the list. -- 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


« previous php.general (#2116) next »