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
Javascript float number
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
theNumber is your number...
Code: Select all
function noDecimals(){
var get_rid_of_decimals = theNumber.split(".");
return get_rid_of_decimals[0];
}