Skip to content

Commit 75bdea5

Browse files
authored
fix(InputNumber): correctly handle decimal point (#8512)
Related tickets: #8511
1 parent fc9c8d4 commit 75bdea5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

components/lib/inputnumber/InputNumber.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,15 @@ export const InputNumber = React.memo(
689689
};
690690

691691
const isFloat = (val) => {
692-
let formatter = new Intl.NumberFormat(_locale, getOptions());
693-
let parseVal = parseValue(formatter.format(val));
692+
let formattedVal = val;
693+
694+
if (typeof formattedVal !== 'string') {
695+
let formatter = new Intl.NumberFormat(_locale, getOptions());
696+
697+
formattedVal = formatter.format(val);
698+
}
699+
700+
let parseVal = parseValue(formattedVal);
694701

695702
if (parseVal === null) {
696703
return false;

0 commit comments

Comments
 (0)