Initial commit

This commit is contained in:
jiapengyu
2026-07-27 13:37:48 +08:00
commit ecba71e2a5
39123 changed files with 5989154 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
exports = function(num) {
num = num.toExponential().match(regExponential);
var coefficient = num[1];
var exponent = parseInt(num[2], 10);
var places = (coefficient.split('.')[1] || '').length;
var ret = places - exponent;
return ret < 0 ? 0 : ret;
};
var regExponential = /^(-?\d?\.?\d+)e([+-]\d)+/;
module.exports = exports;