„gaboshlib/g_percentage-diff.bashfunc“ hinzufügen
This commit is contained in:
parent
7bd0e1790c
commit
bbf01d8a60
8
gaboshlib/g_percentage-diff.bashfunc
Normal file
8
gaboshlib/g_percentage-diff.bashfunc
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
function g_percentage-diff {
|
||||
local g_from=$1
|
||||
local g_to=$2
|
||||
local g_diff=$(echo "scale=8; $g_to-$g_from" | bc | sed 's/^\./0./; s/^-\./-0./')
|
||||
echo "scale=8; 100/$g_from*$g_diff" | bc | sed 's/^\./0./; s/^-\./-0./'
|
||||
}
|
Loading…
Reference in New Issue
Block a user