summaryrefslogtreecommitdiff
path: root/bips
blob: 7df76cdd66f2392c0c54412c07e2915570e18048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
networth=$(hledger bal ^as ^li --value=now,USD --output-format=csv \
    | tail -n 1 \
    | tr -d [totalUSD,\"]
)
bp=$(bc -l <<< "$networth * 0.0001")
if [[ $1 == "--from" ]]
then
    printf "%0.f USD" $(bc -l <<< "$bp * $2")
else
    printf "%.0f bips" $(bc -l <<< "$1/$bp")
fi