wallet-core/node_modules/core-js/modules/es6.number.to-precision.js

18 lines
615 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
'use strict';
var $export = require('./_export')
, $fails = require('./_fails')
, aNumberValue = require('./_a-number-value')
, $toPrecision = 1..toPrecision;
$export($export.P + $export.F * ($fails(function(){
// IE7-
return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function(){
// V8 ~ Android 4.3-
$toPrecision.call({});
})), 'Number', {
toPrecision: function toPrecision(precision){
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
}
});