Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: int($x) gives strange result

by busunsl (Vicar)
on Aug 24, 2009 at 06:31 UTC ( #790751=note: print w/replies, xml ) Need Help??


in reply to int($x) gives strange result

If you just want to cut off decimal places you can use the sprintf function:
$x = sprintf('%.2f', $x);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://790751]
help
Chatterbox?
[LanX]: typo sorry meant protlose
[LanX]: ;)
[LanX]: see protwin situation
[QM]: Anything like a qualtoo?
[QM]: er, quatloo
[shmem]: ah, silly typo. protein :(

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-08-17 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (286 votes). Check out past polls.

    Notices?