canvacord
Advanced tools
Comparing version 5.4.6 to 5.4.7
{ | ||
"name": "canvacord", | ||
"version": "5.4.6", | ||
"version": "5.4.7", | ||
"description": "Powerful image manipulation package for beginners.", | ||
@@ -56,3 +56,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@napi-rs/canvas": "^0.1.26", | ||
"@napi-rs/canvas": "^0.1.29", | ||
"@skyra/gifenc": "^1.0.0", | ||
@@ -59,0 +59,0 @@ "chalk": "^5.0.1", |
module.exports = num => { | ||
if (!num || isNaN(num)) return "0"; | ||
if (typeof num === "string") num = parseInt(num); | ||
let decPlaces = Math.pow(10, 1); | ||
var abbrev = ["K", "M", "B", "T"]; | ||
for (var i = abbrev.length - 1; i >= 0; i--) { | ||
var size = Math.pow(10, (i + 1) * 3); | ||
if (size <= num) { | ||
num = Math.round((num * decPlaces) / size) / decPlaces; | ||
if (num == 1000 && i < abbrev.length - 1) { | ||
num = 1; | ||
i++; | ||
if (typeof Intl !== "undefined") { | ||
return new Intl.NumberFormat("en", { notation: "compact" }).format(num); | ||
} else { | ||
let decPlaces = Math.pow(10, 1); | ||
var abbrev = ["K", "M", "B", "T"]; | ||
for (var i = abbrev.length - 1; i >= 0; i--) { | ||
var size = Math.pow(10, (i + 1) * 3); | ||
if (size <= num) { | ||
num = Math.round((num * decPlaces) / size) / decPlaces; | ||
if (num == 1000 && i < abbrev.length - 1) { | ||
num = 1; | ||
i++; | ||
} | ||
num += abbrev[i]; | ||
break; | ||
} | ||
num += abbrev[i]; | ||
break; | ||
} | ||
return `${num}`; | ||
} | ||
return `${num}`; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220958
4435
Updated@napi-rs/canvas@^0.1.29