-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from silinternational/feature/improve-MoneyIn…
…put-step fix(MoneyInput): fix 1x10e-n not being caught by step
- Loading branch information
Showing
3 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
export const addOrRemoveInvalidClass = async (isInvalid, element) => { | ||
isInvalid ? element.classList?.add('mdc-text-field--invalid') : element.classList?.remove('mdc-text-field--invalid') | ||
} | ||
|
||
export function getDecimalPlacesLength(number = 0) { | ||
const string = String(number) | ||
const length = string.includes('e-') ? string.split('e-')?.[1] : string.split('.')[1]?.length | ||
return Number(length || 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters