JavaScript doubleval
!No description available for doubleval. @php.js developers: Please update the function summary text file.
1 2 3 4 56 7 8 9 1011 12 13 | function doubleval (mixed_var) { // !No description available for doubleval. @php.js developers: Please update the function summary text file. // // version: 909.322 // discuss at: http://phpjs.org/functions/doubleval // + original by: Brett Zamir (http://brett-zamir.me) // - 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 this.floatval(mixed_var); } |
Examples
Running
1 | doubleval(186); |
Should return
1 | 186.00 |
Dependencies
In order to use this function, you also need:
Open syntax issues
php.js uses JsLint to help us keep our code consistent and prevent some common bugs.
Eventually we want all code to pass or at least take into consideration most fixes suggested by JsLint, following this JsLint configuration we’ve decided on.
Authors
Thanks to the following developers, you get to have doubleval goodness in JavaScript.
No comments yet. Be the first!

spread the word:
Use any PHP function in JavaScript
These kind folks have already donated: Anonymous and Shawn Houser.
<your name here>