Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jb55/bcalc
A simple calculator that understands Bitcoin units
https://github.com/jb55/bcalc
bitcoin calculator units
Last synced: about 1 month ago
JSON representation
A simple calculator that understands Bitcoin units
- Host: GitHub
- URL: https://github.com/jb55/bcalc
- Owner: jb55
- License: other
- Created: 2017-12-17T06:41:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-01T18:36:35.000Z (10 months ago)
- Last Synced: 2024-02-01T19:56:46.730Z (10 months ago)
- Topics: bitcoin, calculator, units
- Language: C
- Size: 41 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bcalc
A simple calculator that understands Bitcoin Units
## Examples
Basic example
$ bcalc 1 msat + 2 sats + 3 bits to msats
302001 msatsBTC to satoshis
$ bcalc 0.02 BTC
2000000 satssatoshis to millisatoshis (for payment channels), also dont print unit
$ bcalc --no-unit 100 sat to msats
100000mBTC + bits to BTC
$ bcalc 100 mBTC + 20 bits to btc
0.10002 BTCDivision
$ bcalc 1 BTC / 100 to bits
10000 bitsMultiplication
$ bcalc '10 mbtc * 30 to bits'
300000 bitsFiat currencies
$ bcalc --price 20000 30 usd to bits
1500 bits$ bcalc --price 16000 780 bits to fiat
12.48 usdThe Bitcoin pizzas
$ bcalc --price 0.0041 41 usd to btc
10000 BTC
Chain analysis
$ bitcoin-iterate -q --output=%oa --start 0 --end 80000 | sed 's,$, sats to btc,g' | bcalc | sort | uniq -c | sort -nr | head -n5
84634 50 BTC
9778 0.01 BTC
7829 0.05 BTC
3064 5 BTC
1326 0.02 BTC## Install
If on Ubuntu, check you have the prerequisites to build this package
$ sudo apt-get install build-essential bison flex
Build and install
$ make install
If you run into errors because your user doesn't have write access to /usr/local/bin then
$ sudo make install
## Units
- BTC,
- mBTC (milli-bitcoin),
- bits (μBTC, micro-bitcoin),
- finney,
- satoshi (sat),
- millisatoshi (msat),