bcalc

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

tests.csv (2041B)


      1 description,args,input,expected output
      2 scalar division,,1 BTC / 10 in btc,0.1 BTC
      3 scalar multiplication,-n,10 * 1 BTC in btc,10
      4 multiply 1 BTC to the smallest unit,,1 BTC * 0.00000000001 in msats,1 msats
      5 multiply 10 BTC to the smallest unit,,10 BTC * 0.000000000001 in msats,1 msats
      6 multiply 100 BTC to the smallest unit,,100 BTC * 0.0000000000001 in msats,1 msats
      7 multiply 1000 BTC to the smallest unit,,1000 BTC * 0.00000000000001 in msats,1 msats
      8 multiply 100000 BTC to the smallest unit,,100000 BTC * 0.0000000000000001 in msats,1 msats
      9 lots of msats,-n,2 msat * 100000000000 in btc,2
     10 chained multiply,-n,2100 btc * 0.1 * 0.1 in btc,21
     11 10000 satoshis in bits,-n,10000 sats in bits,100
     12 satoshis in bits to smallest bit,,10000 sats * 0.01 in bits,1 bits
     13 parens,-n,(10 finney * 1000) / 10 in btc,0.0001
     14 finney plural,-n,10 finneys in finneys,10
     15 finney singular,-n,10 finney in finneys,10
     16 satoshi singular,,10 sat,10 sat
     17 satoshi plural,,10 sats,10 sat
     18 msat singular,,1 msat in msat,1 msats
     19 msat plural,,1 msats in msat,1 msats
     20 arg tokens work,1 BTC in mbtc,,1000 mBTC
     21 simple fiat test,--price 15000,1 fiat in msats,6666666 msats
     22 simple fiat test with bits,--price 15000,1 fiat in bits,66.66666 bits
     23 1 usd is 1 BTC,--price 1,1 usd in btc,1 BTC
     24 1 BTC is 10 usd,--price 10,1 btc in usd,10 usd
     25 1 BTC is 1000000 fiat,--price 1000000,100 mbtc in fiat,100000 fiat
     26 1 other @15k is 66.66666 bits,--price 15000,1 other in bits,66.66666 bits
     27 1 btc/2 should work,-n,1 btc / 2 in btc,0.5
     28 60 usd at 25000 in bits,--price 25000,60 fiat in bits,2400 bits
     29 penny usd to msats,--price 20000,0.01 usd in msats,50000 msats
     30 100 mbtc in bits grammar,,100 mbtc in bits,100000 bits
     31 100 mbtc in bits grammar with arith,,100 mbtc + 2 btc in btc,2.1 BTC
     32 set usb in grammar,--price 16000,780 bits in usd,12.48 usd
     33 --- failing ---,,,
     34 bitcoin pizzas,--price 0.0041,41 usd to btc,10000 btc
     35 no floating point issues,,0.1284502 btc in sats,12845020 sats
     36 1 BTC is 15000 usd,--price 15000,1 btc in usd,15000 USD
     37 --- needs implementation ---,,,
     38 1/2 btc should work,,1/2 btc,0.5