Javascript float number

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
aetoc
Forum Commoner
Posts: 37
Joined: Tue Jan 31, 2006 2:48 am

Javascript float number

Post 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
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post by iknownothing »

theNumber is your number...

Code: Select all

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

return get_rid_of_decimals[0];
}
aetoc
Forum Commoner
Posts: 37
Joined: Tue Jan 31, 2006 2:48 am

Post by aetoc »

Thanks iknownothing.
Post Reply