dotfiles/.local/bin/scripts/=

6 lines
227 B
Bash
Executable File

#!/bin/bash
# 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/'