
parseFloat() w/two args
hi,
I'm trying to implement jQuery a fontresize script
got from here,
http://devtips.com/featured/jquery...fontresizing
my implementation is not working, and I'm trying to figure out what the 2nd argument in his parseFloat fn is
Code:
var finalNum = parseFloat(currFontSize, 10);
(is it maybe the default fontsize in my 'body' tag?)
I searched for javascript parseFloat() fn, but have not found any examples of this fn with two arguments..
thank you..

1 Attachment(s)
my implementation is attached.. I don't know why it's not working (for a splitsecond I saw a larger font when clicked on largerfont button, but it disappeared..)
(for the 1st time attaching a file to my post since can't get to my ftp right now..it's just an HTML, all JS and CSS is in there.. (had to convert to .txt.. why can't you attach an .html file, it's just a text file..))
thank you..

oh brother.. I got it.. since am binding to a link (not an input) had forgotten e.preventDefault..
but I still have a few questions, I still would like to know what that 2nd arg is in parseFloat fn; I would like to know why for multiplying he has '*=' instead of just '*' (same thing for dividing..); and: I don't know if this can be done w/this script, I might have to use another script....
they want on every click fontsize to change by 1 px,, same thing going down (when you click on 'smaller font' button that fontsize decrease by ONE pixel... is it possible to alter this script to do this?)
(I multiply and divide in my example by 2 to make it more dramatic so I could see results clearly; it actually works pretty well with 1.2, but not sure that's what they want..)
thank you very much...

The purpose of both parseInt and parseFloat are to convert numers from one base (anywhere from base 2 to base 36) into numbers in base 10.
Where the number in the first parameter starts with '0x' it is assumed to be base 16 if the base isn't specified in the second parameter. If it starts with a '0' it is assumed to be base 8 and if it starts with anything else it is assumed to be base 10. You get around these assumptions and can select any other number base between 2 and 36 by specifying the number base in the second parameter.
If you are not sure what number bases are about then base 2 is bianry where all numbers are expressed using nothing but 0 and 1. Base 8 is octal which uses numbers from 0 through 7 and 8 is written as 010. Hexadecimal uses 09 and af to represent the numbers with 16 being written as 0x10. Base 26 uses all the numbers 09 and all the letters az to represent numbers up to 35 as a single digit.