[Javascript] Is integer?

João Cândido de Souza Neto joao at curitibaonline.com.br
Mon May 29 09:29:55 CDT 2006


Look at this. There you can found the answer to your question.

http://www.crockford.com/javascript/remedial.html

----- Original Message ----- 
From: "Peter Lauri" <lists at dwsasia.com>
To: <javascript at LaTech.edu>
Sent: Monday, May 29, 2006 5:27 AM
Subject: [Javascript] Is integer?


> 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
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 




More information about the Javascript mailing list