Skip to content

type.Integer

Compare
Choose a tag to compare
@matthewp matthewp released this 10 Oct 17:49
· 17 commits to master since this release

This is a minor release that adds type.Integer as a convenient way to get an integer type. This is useful when you want to convert to whole, non-fractional numbers.

import { Reflect, type } from "can";

let ConvertingInteger = type.convert(type.Integer);
let val = Reflect.convert(12.1, ConvertingInteger);

console.log(val); // -> 12