Page 1 of 1

Javascript float number

Posted: Mon Aug 06, 2007 3:54 am
by aetoc
I have a number for ex 12.678 and I would like to seperate the 12 from the whole number.

Any help gays?

Thanks in advance,
Aetoc

Posted: Mon Aug 06, 2007 5:01 am
by iknownothing
theNumber is your number...

Code: Select all

function noDecimals(){
var get_rid_of_decimals = theNumber.split(".");

return get_rid_of_decimals[0];
}

Posted: Mon Aug 06, 2007 5:02 am
by aetoc
Thanks iknownothing.