#!/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\n" $(bc -l <<< "$bp * $2") else printf "%.0f bips\n" $(bc -l <<< "$1/$bp") fi