1.0.3 • Published 6 months ago

@ilihub/decimal v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@ilihub/decimal

Decimal number system conversion typescript functions

NPM Version NPM CodeFactor Socket Badge

Installation

# if you're using pnpm
pnpm add @ilihub/decimal

# or, if you're using npm
npm install @ilihub/decimal

# or, if you're using yarn
yarn add @ilihub/decimal

Usage

import { Decimal } from "@ilihub/decimal";

const decimal = new Decimal(65);

const ascii = decimal.toAscii();
console.log(ascii); // A

const binary = decimal.toBinary();
console.log(binary); // 1000001

const hexadecimal = decimal.toHexadecimal();
console.log(hexadecimal); // 41

const octal = decimal.toOctal();
console.log(octal); // 101

Sponsors & Backers

Support the development of new open-source projects from ilihub through crowdfunding.

The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.

Sponsors