View Single Post
Old 06-09-2012, 04:44 AM   PM User | #11
Krupski
Regular Coder

 
Krupski's Avatar
 
Join Date: Dec 2010
Location: United States of America
Posts: 502
Thanks: 39
Thanked 47 Times in 46 Posts
Krupski is on a distinguished road
Quote:
Originally Posted by felgall View Post
but parseInt() in JavaScript doesn't convert the values to integers, it converts between number bases eg base 16 to base 10

Math.floor() is the JavaScript function to convert from a float to an integer.
We are like "Rock'em-Sock'em Robots"... trying to knock off each other's block.

parseInt defaults to base 10 so it does the same thing as Math.floor.

As to which one is "better"... does it matter? Do you eat the cake first, or the frosting first? And does it matter either way?

__________________
"Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov
Krupski is offline   Reply With Quote