generated from react-component/portal
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @rc-component/mini-decimal@1.1.0 for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@rc-component/mini-decimal/es/MiniDecimal.js b/node_modules/@rc-component/mini-decimal/es/MiniDecimal.js
index 17c4ead..f707338 100644
--- a/node_modules/@rc-component/mini-decimal/es/MiniDecimal.js
+++ b/node_modules/@rc-component/mini-decimal/es/MiniDecimal.js
@@ -39,7 +39,7 @@ export function toFixed(numStr, separatorStr, precision) {
return toFixed(advancedDecimal.toString(), separatorStr, precision, cutOnly);
}
if (precision === 0) {
- return numberWithoutDecimal;
+ return integerStr === '0' ? integerStr : numberWithoutDecimal;
}
return "".concat(numberWithoutDecimal).concat(separatorStr).concat(decimalStr.padEnd(precision, '0').slice(0, precision));
}
diff --git a/node_modules/@rc-component/mini-decimal/lib/MiniDecimal.js b/node_modules/@rc-component/mini-decimal/lib/MiniDecimal.js
index 91e3663..ff588aa 100644
--- a/node_modules/@rc-component/mini-decimal/lib/MiniDecimal.js
+++ b/node_modules/@rc-component/mini-decimal/lib/MiniDecimal.js
@@ -58,7 +58,7 @@ function toFixed(numStr, separatorStr, precision) {
return toFixed(advancedDecimal.toString(), separatorStr, precision, cutOnly);
}
if (precision === 0) {
- return numberWithoutDecimal;
+ return integerStr === '0' ? integerStr : numberWithoutDecimal;
}
return "".concat(numberWithoutDecimal).concat(separatorStr).concat(decimalStr.padEnd(precision, '0').slice(0, precision));
}This issue body was partially generated by patch-package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels