Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit cb9f69b

Browse files
author
Shammamah Hossain
committed
Save parseInt and parseFloat values.
1 parent 79142f9 commit cb9f69b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Input.react.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ export default class Input extends PureComponent {
9393
}
9494

9595
getValueAsNumber(value) {
96-
if (parseInt(value, 10) !== parseFloat(value)) {
97-
return parseFloat(value);
98-
}
99-
return parseInt(value, 10);
96+
let intVal = parseInt(value, 10);
97+
let floatVal = parseFloat(value);
98+
99+
return intVal == floatVal ? intVal : floatVal;
100100
}
101101

102102
setInputValue(base, value) {

0 commit comments

Comments
 (0)