mining-numbers
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Mining numbers

CI

Convert mining number from number/string to number/string

Install

npm install mining-numbers

Usage

import { Hashrate, Difficulty } from 'mining-numbers'

// Supported units 'H/s', 'KH/s', 'MH/s', 'GH/s', 'TH/s', 'PH/s', 'EH/s'
Hashrate.parse(1500).toString() // 1.5 KH/s
Hashrate.parse('1.5 KH/s').toNumber() // 1500
Hashrate.parse('1.5KH/s').toNumber() // 1500

// Supported units 'k', 'M', 'B', 'T', 'P', 'E'
Difficulty.parse(1500).toString() // 1.50K
Difficulty.parse('1.50k').toNumber() // 1500
Difficulty.parse('1.50 k').toNumber() // 1500

Contribue

# install dependencies
bun install

# test the app
bun test

# build the app, available under dist
bun run build

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i mining-numbers

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

5.23 kB

Total Files

5

Last publish

Collaborators

  • dolu