Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
612 bytes
|
Line | |
---|
1 | var global = require('../internals/global');
|
---|
2 | var toString = require('../internals/to-string');
|
---|
3 | var trim = require('../internals/string-trim').trim;
|
---|
4 | var whitespaces = require('../internals/whitespaces');
|
---|
5 |
|
---|
6 | var $parseFloat = global.parseFloat;
|
---|
7 | var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
|
---|
8 |
|
---|
9 | // `parseFloat` method
|
---|
10 | // https://tc39.es/ecma262/#sec-parsefloat-string
|
---|
11 | module.exports = FORCED ? function parseFloat(string) {
|
---|
12 | var trimmedString = trim(toString(string));
|
---|
13 | var result = $parseFloat(trimmedString);
|
---|
14 | return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
|
---|
15 | } : $parseFloat;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.