Skip to content

Commit

Permalink
fix: Treat 0 padded number as string (#5137)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Feb 25, 2025
1 parent c61839e commit 65058e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/common/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ const Utils = Object.assign({}, require('./base/_utils'), {
}

const typedValue = testWithTrim ? str.trim() : str
const isNum = /^-?\d+$/.test(typedValue)
// Check if the value is sensible number, returns false if it has leading 0s
const isNum = /^-?(0|[1-9]\d*)$/.test(typedValue)

if (isNum && parseInt(typedValue) > Number.MAX_SAFE_INTEGER) {
return `${str}`
Expand Down

0 comments on commit 65058e3

Please sign in to comment.