MyCrypto/common/libs/inputValidator.js

16 lines
272 B
JavaScript
Raw Normal View History

2017-06-11 20:02:39 -05:00
export function isInt(n) {
return Number(n) === n && n % 1 === 0;
}
export function isFloat(n) {
return Number(n) === n && n % 1 !== 0;
}
export function isEmpty(n) {
return n === ''
}
export function isFloatOrInt(n) {
return (isFloat(n) || isInt(n))
}