Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Is integer?
- From: lists at dwsasia.com (Peter Lauri)
- Subject: [Javascript] Is integer?
- Date: Mon May 29 08:28:24 2006
Best group member,
Is there any function that checks if something is an integer? I did not find
one and created this temporary function:
function isInteger(thenumber) {
thenumberceil = Math.ceil(thenumber);
if(thenumberceil>thenumber) return false;
else return true;
}
Why I actually need this is because I need to find out if a year is a "skott
year" (do not know the English word, but the years when February has 29 days
instead of 28). Is there any function for that? I created this temporary
function:
function isSkottYear(y) {
yeardiv = y/4;
if(isInteger(yeardiv)) return true;
else return false;
}
There is probably better ways of doing this, are they?
Best regards,
Peter Lauri
- Follow-Ups:
- [Javascript] Is integer?
- From: Allard Schripsema
- [Javascript] Is integer?
- From: Nick Fitzsimons
- [Javascript] Is integer?
- From: joel.goldstick@xxxxxxxxxxxxxxxxxxxxx
- [Javascript] Is integer?
- From: Hassan Schroeder
- [Javascript] Is integer?
- From: João Cândido de Souza Neto
- [Javascript] Is integer?
- Prev by Date: [Javascript] Form change
- Next by Date: [Javascript] Form change
- Previous by thread: [Javascript] Form change
- Next by thread: [Javascript] Is integer?
- Index(es):