@augment-vir/common
Advanced tools
Comparing version 18.1.0 to 18.1.1
@@ -11,3 +11,5 @@ "use strict"; | ||
} | ||
const stringValue = String(input); | ||
const numericValue = Number(input); | ||
const isNegative = numericValue < 0; | ||
const stringValue = String(Math.abs(numericValue)); | ||
const [digits, decimalValues,] = stringValue.split('.'); | ||
@@ -18,4 +20,9 @@ const decimalString = decimalValues ? `.${decimalValues}` : ''; | ||
.map((entry) => entry.split('').reverse().join('')); | ||
const withCommas = separated.join(','); | ||
return `${withCommas}${decimalString}`; | ||
const valueWithCommas = separated.join(','); | ||
const negativeMarker = isNegative ? '-' : ''; | ||
return [ | ||
negativeMarker, | ||
valueWithCommas, | ||
decimalString, | ||
].join(''); | ||
} | ||
@@ -22,0 +29,0 @@ exports.addCommasToNumber = addCommasToNumber; |
@@ -8,3 +8,5 @@ import { removeCommasFromNumberString } from './common-string'; | ||
} | ||
const stringValue = String(input); | ||
const numericValue = Number(input); | ||
const isNegative = numericValue < 0; | ||
const stringValue = String(Math.abs(numericValue)); | ||
const [digits, decimalValues,] = stringValue.split('.'); | ||
@@ -15,4 +17,9 @@ const decimalString = decimalValues ? `.${decimalValues}` : ''; | ||
.map((entry) => entry.split('').reverse().join('')); | ||
const withCommas = separated.join(','); | ||
return `${withCommas}${decimalString}`; | ||
const valueWithCommas = separated.join(','); | ||
const negativeMarker = isNegative ? '-' : ''; | ||
return [ | ||
negativeMarker, | ||
valueWithCommas, | ||
decimalString, | ||
].join(''); | ||
} | ||
@@ -19,0 +26,0 @@ export function clamp( |
{ | ||
"name": "@augment-vir/common", | ||
"version": "18.1.0", | ||
"version": "18.1.1", | ||
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", | ||
@@ -5,0 +5,0 @@ "bugs": { |
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
161275
3876