@heyform-inc/utils 1.2.0 → 1.2.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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -400,7 +400,9 @@ function toFloat(value, defaults, maxValue) {
|
|
|
400
400
|
return maxValue ? Math.min(maxValue, val) : val;
|
|
401
401
|
}
|
|
402
402
|
function toFixed(value, precision = 2) {
|
|
403
|
-
|
|
403
|
+
if (isNumber(value)) {
|
|
404
|
+
return value.toFixed(precision).replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
|
|
405
|
+
}
|
|
404
406
|
}
|
|
405
407
|
function toJSON(str, defaults) {
|
|
406
408
|
let value;
|