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


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Variable handling »

 

Javascript doubleval


Examples
Example 1

Running
1.doubleval(186);

Could return
1.186.00
function doubleval( mixed_var ) {
    // !No description available for doubleval. @php.js developers: Please update the function summary text file.
    // 
    // version: 901.2515
    // discuss at: http://phpjs.org/functions/doubleval
    // +   original by: Brett Zamir
    //  -   depends on: floatval
    // %        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: doubleval(186);
    // *     returns 1: 186.00
    return floatval(mixed_var);
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Variable handling