We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 104b940 commit 79c1c7fCopy full SHA for 79c1c7f
src/shared/util.js
@@ -16,8 +16,8 @@ export function _toString (val: any): string {
16
* If the conversion fails, return original string.
17
*/
18
export function toNumber (val: string): number | string {
19
- const n = parseFloat(val, 10)
20
- return (n || n === 0) ? n : val
+ const n = parseFloat(val)
+ return isNaN(n) ? val : n
21
}
22
23
/**
0 commit comments