Skip to content

Dolu89/mining-numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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