@ilihub/decimal
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@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


Package Sidebar

Install

npm i @ilihub/decimal

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

6.98 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843