Page 1 of 1

converting 1,599.12 to a float value

Posted: Tue Sep 28, 2004 11:10 am
by pelegk2
i tried to convert 1,599.12 to a float number using floatval()
but the value i get is 2!!!!
why is that?
what to do?
thnaks in advance
Peleg

Posted: Tue Sep 28, 2004 12:56 pm
by feyd
does the value you are trying to convert have the comma? .. remove it.

yes it does

Posted: Wed Sep 29, 2004 2:04 am
by pelegk2
i finally removed the comma
but isnt there any way withogut removing the comma?

Posted: Wed Sep 29, 2004 9:41 am
by feyd
not really.. commas aren't apart of decimal numbers as far as php is concerned. They are an addition by humans to make it easier on us.