Skip to content

Commit

Permalink
fix:format error when Locale set de-DE (#5634)
Browse files Browse the repository at this point in the history
* fix:format error when Locale set de-DE

* fix:inputnumber cursor
  • Loading branch information
kl-nevermore authored Dec 22, 2023
1 parent aac57b8 commit e2f9be9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e2f9be9

Please sign in to comment.