PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Tue Sep 28, 2004 11:10 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 28, 2004 12:56 pm
does the value you are trying to convert have the comma? .. remove it.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Wed Sep 29, 2004 2:04 am
i finally removed the comma
but isnt there any way withogut removing the comma?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Sep 29, 2004 9:41 am
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.