Re: [PHP] Working with numbers

2001-05-09 Thread Christian Dechery
At 11:22 9/5/2001 -0700, Gerry wrote: >Could you suggest a function for displaying decimal zeros. > >For example I have this: >$num = "2.00"; >$num2 = "3.00"; >$result = $num + $num2; >echo "$result"; > >I get "5" but not "5.00" try $result = (float)$num + (float)$num2; -- PHP General Mailing

Re: [PHP] Working with numbers

2001-05-09 Thread Reuben D Budiardja
Use number_format() function. See http://www.php.net/manual/en/function.number-format.php for detail. Reuben D. B At 11:22 AM 5/9/01 -0700, Gerry wrote: >Could you suggest a function for displaying decimal zeros. > >For example I have this: >$num = "2.00"; >$num2 = "3.00"; >$result = $num + $nu

[PHP] Working with numbers

2001-05-09 Thread Gerry
Could you suggest a function for displaying decimal zeros. For example I have this: $num = "2.00"; $num2 = "3.00"; $result = $num + $num2; echo "$result"; I get "5" but not "5.00" Anyone outhere? Thanks in advance! Gerry Figueroa -- PHP General Mailing List (http://www.php.net/) To unsubsc

Re: [PHP] Working with numbers

2001-05-04 Thread Gyozo Papp
ut. - Original Message - From: "Jennifer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 2001. május 4. 07:39 Subject: Re: [PHP] Working with numbers > > > Christian Reiniger wrote: > > > > On Thursday 03 May 2001 08:53, Jennifer wrote: > >

Re: [PHP] Working with numbers

2001-05-03 Thread Oliver Heinisch
At 01:39 04.05.01 -0400, you wrote: Ok Jennifer lets do some "basics" ;-) >I've done some searching on the php site for more info about >double and float etc, but I don't really understand anything I >found. Can someone give me an explanation about the difference >between decimal, float, double?

Re: [PHP] Working with numbers

2001-05-03 Thread Jennifer
Christian Reiniger wrote: > > On Thursday 03 May 2001 08:53, Jennifer wrote: > > > I have a shopping cart that allows decimal points for quantities. > > I like it like that, but would like to remove any trailing zeros > > and if the quantity is not a fraction I would like to remove the > > dec

Re: [PHP] Working with numbers

2001-05-03 Thread Gyozo Papp
what about function round() with precision argument ? check it: for ($i = 0; $i < 10; $i += 0.25) { echo round($i,2). ""; } - Original Message - From: "Jennifer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 2001. május 3. 08:53 Subject: [PHP

Re: [PHP] Working with numbers

2001-05-03 Thread Christian Reiniger
On Thursday 03 May 2001 08:53, Jennifer wrote: > I have a shopping cart that allows decimal points for quantities. > I like it like that, but would like to remove any trailing zeros > and if the quantity is not a fraction I would like to remove the > decimal point too. > > What would be the easie

[PHP] Working with numbers

2001-05-02 Thread Jennifer
I have a shopping cart that allows decimal points for quantities. I like it like that, but would like to remove any trailing zeros and if the quantity is not a fraction I would like to remove the decimal point too. What would be the easiest way to do this? I don't see any function that would mak