Skip to content
Snippets Groups Projects
Commit f2de2983 authored by Alexander Rose's avatar Alexander Rose
Browse files

added isInteger helper

parent 82c84997
No related branches found
No related tags found
No related merge requests found
......@@ -46,4 +46,10 @@ export function getArrayDigitCount(xs: ArrayLike<number>, maxDigits: number, del
}
}
return { mantissaDigits, integerDigits };
}
export function isInteger(s: string) {
s = s.trim()
const n = parseInt(s, 10)
return isNaN(n) ? false : n.toString() === s
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment