dotfiles/.local/bin/scripts/=

6 lines
253 B
Bash
Executable File

#!/bin/bash -ex
# Shortcut for mathematical calculations
# 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/'