0.1.1 • Published 3 years ago

@jellybeanci/int v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

int

Integer type caster module for JavaScript/TypeScript.

npm i @jellybeanci/int

import module

// ES6 Syntax
import {int} from "@jellybeanci/int";

// Commonjs Syntax
const {int} = require("@jellybeanci/int");

// Commonjs with custom name
const integer = require("@jellybeanci/int").int;

usage

const integerNumber = int(floatingPointNumber);

const parsedIntegerNumber = int(stringNumber);

demo

console.log(int(3.1415)); // 3

console.log(int(-6.2342)); // -6

console.log(int("25.3")); // 25

console.log(int("not a number")); // 0

types

type intFunctionType = (numberValue: number | string) => number;
0.1.0

3 years ago

0.1.1

3 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago