@oliasoft-open-source/units 5.4.2 → 5.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/numbers/numbers.d.cts +1 -1
- package/dist/numbers/numbers.d.cts.map +1 -1
- package/dist/numbers/numbers.d.ts +1 -1
- package/dist/numbers/numbers.d.ts.map +1 -1
- package/dist/units.d.cts.map +1 -1
- package/dist/units.d.ts.map +1 -1
- package/dist/units2.cjs +2 -2
- package/dist/units2.cjs.map +1 -1
- package/dist/units2.js +2 -2
- package/dist/units2.js.map +1 -1
- package/package.json +1 -1
package/dist/units2.js
CHANGED
|
@@ -170,7 +170,7 @@ const parseNumber = (value, preserveTrailingZeros = false) => {
|
|
|
170
170
|
* @returns number or string output value
|
|
171
171
|
*/
|
|
172
172
|
const safeStringifyNumber = (value, isScientific) => {
|
|
173
|
-
return isScientific ? String(value) :
|
|
173
|
+
return isScientific ? String(value) : toString(value);
|
|
174
174
|
};
|
|
175
175
|
/**
|
|
176
176
|
* Internal function to unParse a value, unit, and type back to an output value
|
|
@@ -2973,7 +2973,7 @@ function convertAndGetValueStrict(value, toUnit, fromUnit) {
|
|
|
2973
2973
|
if (typeof value === "string" && isValueWithUnit(value) && getValue(value) === "") return "";
|
|
2974
2974
|
const isString = typeof value === "string";
|
|
2975
2975
|
const result = convertAndGetValue(value, toUnit, fromUnit);
|
|
2976
|
-
return isString ?
|
|
2976
|
+
return isString ? toString(result) : result;
|
|
2977
2977
|
}
|
|
2978
2978
|
/**
|
|
2979
2979
|
* Convert value to the base unit given by the quantity
|