Skip to content

Commit

Permalink
convert to a number
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbitronics committed Apr 13, 2022
1 parent b259697 commit 980ddfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/mdc/TextInput/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const addOrRemoveInvalidClass = async (isInvalid, element) => {
export function getDecimalPlacesLength(number = 0) {
const string = String(number)
const length = string.includes('e-') ? string.split('e-')?.[1] : string.split('.')[1]?.length
return length || 0
return Number(length || 0)
}

0 comments on commit 980ddfa

Please sign in to comment.