optimized function
This commit is contained in:
parent
16f5b7b928
commit
43d38ee537
@ -3,6 +3,5 @@
|
|||||||
function g_percentage-diff {
|
function g_percentage-diff {
|
||||||
local g_from=$1
|
local g_from=$1
|
||||||
local g_to=$2
|
local g_to=$2
|
||||||
local g_diff=$(echo "scale=8; $g_to-$g_from" | bc | sed 's/^\./0./; s/^-\./-0./')
|
echo "scale=2; 100/$g_from*($g_to-$g_from)" | bc | sed 's/^\./0./; s/^-\./-0./' | xargs printf "%.2f"
|
||||||
echo "scale=8; 100/$g_from*$g_diff" | bc | sed 's/^\./0./; s/^-\./-0./' | xargs printf "%.2f"
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user