🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

sp-math

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sp-math - npm Package Compare versions

Comparing version
1.0.4
to
1.0.5
+1
-1
package.json
{
"name": "sp-math",
"version": "1.0.4",
"version": "1.0.5",
"description": "Common Math Functions",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ /**

let {
fixedLen = 2, hasComma = false
fixed = 2, hasComma = false
} = obj;

@@ -14,7 +14,7 @@

if (hasComma && (+value)) {
let fixed = (+value).toFixed(fixedLen).split('.');
if (fixedLen > 0) {
return `${(+fixed[0]).toLocaleString()}.${fixed[1]}`;
let fix = (+value).toFixed(fixed).split('.');
if (fixed > 0) {
return `${(+fix[0]).toLocaleString()}.${fix[1]}`;
} else {
return (+fixed[0]).toLocaleString();
return (+fix[0]).toLocaleString();
}

@@ -25,3 +25,3 @@

let num = +((value.toString()).replace(/\,/ig, ''));
return num ? num.toFixed(fixedLen) : (0).toFixed(fixedLen)
return num ? num.toFixed(fixed) : (0).toFixed(fixed)
}

@@ -28,0 +28,0 @@ }