summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/var/floatval.js.map
blob: cd67f57c73cdeedc972bdfda1cad8f15ee9c88a0 (plain) (blame)
1
{"version":3,"sources":["../../../src/php/var/floatval.js"],"names":["module","exports","floatval","mixedVar","parseFloat"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,QAAnB,EAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAQC,WAAWD,QAAX,KAAwB,CAAhC;AACD,CAbD","file":"floatval.js","sourcesContent":["module.exports = function floatval (mixedVar) {\n  //  discuss at: http://locutus.io/php/floatval/\n  // original by: Michael White (http://getsprink.com)\n  //      note 1: The native parseFloat() method of JavaScript returns NaN\n  //      note 1: when it encounters a string before an int or float value.\n  //   example 1: floatval('150.03_page-section')\n  //   returns 1: 150.03\n  //   example 2: floatval('page: 3')\n  //   example 2: floatval('-50 + 8')\n  //   returns 2: 0\n  //   returns 2: -50\n\n  return (parseFloat(mixedVar) || 0)\n}\n"]}