dotfiles/.local/bin/scripts/=

6 lines
253 B
Plaintext
Raw Normal View History

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