diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2025-06-04 10:16:12 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2025-06-04 10:16:12 -0500 |
| commit | b69040fda091cb2a55e00c05e924cd0c0a42cb57 (patch) | |
| tree | 7b6c8282841c2f6a3767c12d5d8bd053847454e9 /env/.local/bin/scripts/math | |
| parent | edf3d20945518c55394975b3641229124776d195 (diff) | |
fixed awesome autostart dir. added wallpaper setter script. made no extension be filetype sh in neovim. renamed some scripts.
Diffstat (limited to 'env/.local/bin/scripts/math')
| -rwxr-xr-x | env/.local/bin/scripts/math | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/env/.local/bin/scripts/math b/env/.local/bin/scripts/math new file mode 100755 index 0000000..26d4854 --- /dev/null +++ b/env/.local/bin/scripts/math @@ -0,0 +1,13 @@ +#!/bin/bash +expression=$1 +precision=$2 + +if [ "$precision" == "" ]; then + precision=1; +fi; + +# Perform arithmetic operation using awk +result=$(awk "BEGIN {printf \"%.${precision}f\n\", $expression}" | sed 's/\.0$//') + +# Print the result +echo "$result" |
