Skip to content

Commit

Permalink
Added comment
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwroc committed Jan 4, 2024
1 parent d9890d5 commit 7acd501
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const isNumber = (value: string | number | undefined): boolean => {
return (value!== undefined && value !== null && value !== '' && !isNaN(Number(value)))
}

/**
* Converts string representation of the number to the actual JS number
* @param value String value to convert
* @returns Result number
*/
export const toNumber = (value: string | number | undefined): number => {
if (typeof(value) == "string") {
// trying to solve decimal number formatting in some langs
Expand Down

0 comments on commit 7acd501

Please sign in to comment.