summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/var/doubleval.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/var/doubleval.js')
-rw-r--r--node_modules/locutus/php/var/doubleval.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/locutus/php/var/doubleval.js b/node_modules/locutus/php/var/doubleval.js
new file mode 100644
index 0000000..77e974b
--- /dev/null
+++ b/node_modules/locutus/php/var/doubleval.js
@@ -0,0 +1,15 @@
+'use strict';
+
+module.exports = function doubleval(mixedVar) {
+ // discuss at: http://locutus.io/php/doubleval/
+ // original by: Brett Zamir (http://brett-zamir.me)
+ // 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
+
+ var floatval = require('../var/floatval');
+
+ return floatval(mixedVar);
+};
+//# sourceMappingURL=doubleval.js.map \ No newline at end of file