From e2f9be949bdbe3ea1988a2b8fcebb2341ea75be1 Mon Sep 17 00:00:00 2001 From: "kl.nevermore" Date: Fri, 22 Dec 2023 20:08:26 +0800 Subject: [PATCH] fix:format error when Locale set de-DE (#5634) * fix:format error when Locale set de-DE * fix:inputnumber cursor --- components/lib/inputnumber/InputNumber.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index a76f604412..271d6afb17 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -555,7 +555,11 @@ export const InputNumber = React.memo( }; const replaceDecimalSeparator = (val) => { - return isDecimalSign(val) ? val.toString().replace(/\.(?=[^.]*$)/, _decimalSeparator.current) : val; + if (isFloat(val)) { + return val.toString().replace(/\.(?=[^.]*$)/, _decimalSeparator.current); + } + + return val; }; const isDecimalSign = (char) => {