source: imaps-frontend/node_modules/core-js/modules/es.number.to-precision.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 815 bytes
Line 
1'use strict';
2var $ = require('../internals/export');
3var uncurryThis = require('../internals/function-uncurry-this');
4var fails = require('../internals/fails');
5var thisNumberValue = require('../internals/this-number-value');
6
7var nativeToPrecision = uncurryThis(1.0.toPrecision);
8
9var FORCED = fails(function () {
10 // IE7-
11 return nativeToPrecision(1, undefined) !== '1';
12}) || !fails(function () {
13 // V8 ~ Android 4.3-
14 nativeToPrecision({});
15});
16
17// `Number.prototype.toPrecision` method
18// https://tc39.es/ecma262/#sec-number.prototype.toprecision
19$({ target: 'Number', proto: true, forced: FORCED }, {
20 toPrecision: function toPrecision(precision) {
21 return precision === undefined
22 ? nativeToPrecision(thisNumberValue(this))
23 : nativeToPrecision(thisNumberValue(this), precision);
24 }
25});
Note: See TracBrowser for help on using the repository browser.