/
round-tofixed.min.js
1 lines (1 loc) · 1.06 KB
/
round-tofixed.min.js
1
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).roundToFixed=e()}}(function(){return function(){return function e(n,t,r){function o(i,u){if(!t[i]){if(!n[i]){var p="function"==typeof require&&require;if(!u&&p)return p(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var a=t[i]={exports:{}};n[i][0].call(a.exports,function(e){return o(n[i][1][e]||e)},a,a.exports,e,n,t,r)}return t[i].exports}for(var f="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}}()({1:[function(e,n,t){function r(e){const[n,t]=Number(e).toExponential().split("e").map(e=>+e);return{mant:n,exp:t}}n.exports=function(e,n=0){if("number"==typeof e&&"number"==typeof n&&Number.isInteger(n)&&(0===n||1===Math.sign(n))){const t=r(e),o=r(Math.round(+(t.mant+"e"+(t.exp+n))));return+(o.mant+"e"+(o.exp-n))}return NaN}},{}]},{},[1])(1)});