conver string to float

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

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

conver string to float

Post by pelegk2 »

i have a float nu,ber like this :
1680.03
when i try to conver it : (float)1680.03
i get the value 1 !!!
why is that?what can i do?
thnaks i nadvance
peleg
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

for the sake of trial, try (int)# and then (float)#

Just reading on php.net because I generally don't know much about these :P
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]floatval[/php_man]
Post Reply