Skip to content

Commit 3c5f911

Browse files
committed
Cleanup
1 parent 85dbe55 commit 3c5f911

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/sif-common-formik-ds/src/utils/numberInputUtils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export const getNumberFromNumberInputValue = (inputValue: string | undefined): n
88
if (typeof inputValue === 'number' && isNaN(inputValue)) {
99
return undefined;
1010
}
11-
if (inputValue.includes('e')) {
12-
return undefined;
13-
}
1411
if (typeof inputValue === 'number') {
1512
return inputValue;
1613
}
14+
if ((inputValue || '').includes('e')) {
15+
return undefined;
16+
}
1717

1818
const cleanedValue = (inputValue || '').trim();
1919

packages/sif-common-formik-ds/src/validation/__tests__/validateNumber.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe(`validateNumber`, () => {
66
});
77
it('returns undefined when value is a valid number or number string', () => {
88
expect(getNumberValidator()('1')).toBeUndefined();
9-
// expect(getNumberValidator()('1.2')).toBeUndefined();
109
expect(getNumberValidator()('1,2')).toBeUndefined();
1110
expect(getNumberValidator()('-1')).toBeUndefined();
1211
expect(getNumberValidator()(' 1')).toBeUndefined();

0 commit comments

Comments
 (0)