2023-04-21 08:55:10 -04:00
|
|
|
export function forceNumber (value: any) {
|
2022-11-15 08:41:55 -05:00
|
|
|
return parseInt(value + '')
|
|
|
|
}
|
|
|
|
|
2023-04-21 08:55:10 -04: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 08:41:55 -05:00
|
|
|
}
|