UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

15 lines (14 loc) 665 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.doubleval = doubleval; const floatval_ts_1 = require("../var/floatval.js"); function doubleval(mixedVar) { // discuss at: https://locutus.io/php/doubleval/ // parity verified: PHP 8.3 // original by: Brett Zamir (https://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 return (0, floatval_ts_1.floatval)(mixedVar); }