bcalc

cli bitcoin unit calculator
git clone git://jb55.com/bcalc
Log | Files | Refs | README | LICENSE

bcalc.1 (2234B)


      1 .de dT
      2 .ds Dt \\$2
      3 ..
      4 .dT Time-stamp: "2019-05-27"
      5 .TH BCALC 1 \*(Dt "bcalc" "User Commands"
      6 .SH NAME
      7 bcalc \- A simple calculator that understands Bitcoin units
      8 .SH SYNOPSIS
      9 .B bcalc
     10 [\fI\,OPTION\/\fR]... [\fI\,EXPRS\/\fR]...
     11 
     12 .SH DESCRIPTION
     13 bcalc accepts calculator-like commands over stdin or as arguments. See EXAMPLES.
     14 
     15 .SS UNITS
     16 .TS
     17 tab(;);
     18 ln.
     19 BTC;100 000 000 sats
     20 mBTC (milli-bitcoin);100 000 sats
     21 bits (╬╝BTC, micro-bitcoin);100 sats
     22 finney;10 sats
     23 satoshi (sat);1 sat
     24 millisatoshi (msat);0.001 sat
     25 .TE
     26 
     27 .SS Basic form
     28 
     29 <expr> [to <UNIT>]
     30 
     31 .SS
     32 Plural insensitivity
     33 .TP
     34 Units can be suffixed with s without any issues: 10 sat, 10 sats, etc
     35 
     36 .SS
     37 Number spacing
     38 .TP
     39 Numbers can have spaces/commas between them for readibility:
     40 bcalc 1 000 000 sats to mbtc
     41 .br
     42 bcalc 10,000 sats to btc
     43 
     44 .SH OPTIONS
     45  
     46 .TP
     47 .BR \-\-P ", " \-\^\-price
     48 An arbitrary fiat price, used for fiat conversions
     49 
     50 .TP
     51 .BR \-\-n ", " \-\^\-no\-unit
     52 Only output the numeric value without the unit
     53 
     54 .SH EXAMPLES
     55 
     56 .SS
     57 Basic example
     58 
     59 .br
     60 bcalc 1 msat + 2 sats + 3 bits to msats
     61 .br
     62 302001 msats
     63 
     64 .SS
     65 BTC to satoshis
     66 
     67 .br
     68 bcalc 0.02 BTC
     69 .br
     70 2000000 sats
     71 
     72 .SS
     73 satoshis to millisatoshis (for payment channels)
     74 Notice that --no-unit,-n hides the unit here
     75 
     76 .br
     77 bcalc --no-unit 100 sat to msats
     78 .br
     79 100000
     80 
     81 .SS
     82 mBTC + bits to BTC
     83 
     84 .br
     85 bcalc 100 mBTC + 20 bits to btc
     86 .br
     87 0.10002 BTC
     88 
     89 .SS
     90 Division
     91 
     92 .br
     93 bcalc 1 BTC / 100 to bits
     94 .br
     95 10000 bits
     96 
     97 .SS
     98 Multiplication
     99 Notice you may need to quote or escape the '*' here
    100 
    101 .br
    102 bcalc '10 mbtc * 30 to bits'
    103 .br
    104 300000 bits
    105 
    106 .SS
    107 Fiat currencies
    108 
    109 .br
    110 bcalc --price 20000 30 usd to bits
    111 .br
    112 1500 bits
    113 
    114 .br
    115 bcalc --price 16000 780 bits to fiat
    116 .br
    117 12.48 usd
    118 
    119 .SS
    120 The Bitcoin pizzas
    121 
    122 .br
    123 bcalc --price 0.0041 41 usd to btc
    124 .br
    125 10000 BTC
    126 
    127 .SS
    128 Chain analysis
    129 
    130 .br
    131 bitcoin-iterate -q --output=%oa --start 0 --end 80000 | sed 's,$, sats to btc,g' | bcalc | sort | uniq -c | sort -nr | head -n5
    132 .br
    133 84634	50 BTC
    134 .br
    135 9778	0.01 BTC
    136 .br
    137 7829	0.05 BTC
    138 .br
    139 3064	5 BTC
    140 .br
    141 1326	0.02 BTC
    142 
    143 
    144 .SH BUGS
    145 Precision issues with BTC -> m/sat conversions such as: bcalc 0.1284502 btc
    146 .br
    147 See https://github.com/jb55/bcalc/issues/2
    148 
    149 .SH AUTHOR
    150 
    151 William Casarin <jb55@jb55.com>
    152 .br
    153 Support my Bitcoin projects: bc1qthsruffh3qcn69hux2tcq87x95x8rmu4fdu9sm