2023-04-21 07:55:10 -05:00
|
|
|
export function forceNumber (value: any) {
|
2022-11-15 07:41:55 -06:00
|
|
|
return parseInt(value + '')
|
|
|
|
}
|
|
|
|
|
2023-04-21 07:55:10 -05:00
|
|
|
export function isOdd (num: number) {
|
|
|
|
return (num % 2) !== 0
|
|
|
|
}
|
|
|
|
|
|
|
|
export function toEven (num: number) {
|
|
|
|
if (isOdd(num)) return num + 1
|
|
|
|
|
|
|
|
return num
|
2022-11-15 07:41:55 -06:00
|
|
|
}
|