dotfiles/.local/bin/scripts/=

6 lines
227 B
Plaintext
Raw Normal View History

#!/bin/bash
2022-01-08 22:09:29 +00:00
# Shortcut for mathematical calculations
# Assumes german numbers as in 1.000,5
calc="$(echo "$@" | sed -e 's/p/+/g' -e 's/\.//g' -e 's/,/./g' -e 's/x/*/g' -e 's/m/-/g')"
bc -l <<<"scale=10;$calc" | sed 's/0\+$/0/'