Javascript is_long : Variable handling : PHP functions in JavaScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Variable handling »

 

Javascript is_long


Returns true if variable is a long (integer)
Example 1

Running
1.is_long(186.31);

Could return
1.true
function is_long( mixed_var ) {
    // Returns true if variable is a long (integer)  
    // 
    // version: 812.1017
    // discuss at: http://phpjs.org/functions/is_long
    // +   original by: Paulo Ricardo F. Santos
    //  -   depends on: is_float
    // %        note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes
    // %        note 1: it different from the PHP implementation. We can't fix this unfortunately.
    // *     example 1: is_long(186.31);
    // *     returns 1: true
    return is_float(mixed_var);
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Variable handling