JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q40611F
  • License MIT

Fixed-point numbers in idiomatic TypeScript

Package Exports

  • @hazae41/fixed

Readme

Fixed

Fixed-point numbers in idiomatic TypeScript

npm i @hazae41/fixed

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Usage

const eth = new Fixed(123n, 0) // 123n
const wei = fixed.move(18) // 123000000000000000000n

const wei2 = wei.add(new Fixed(1n, 18)) // 123000000000000000001n

const str = wei2.toString() // "123.000000000000000001"