It shows to you the percentage of value of a total.
SYNTAX: /percent
ex: /percent 100 10
Result:
TOTAL: 100 VALUE: 10
PERCENTAGE: |||||||||||||||||||| 10%
percent {
var %percent $iif($round($calc(($2 * 100) / $1),1) > 100, 100, $round($calc(($2 * 100) / $1),1)) $+ %
var %num $iif($2 > $1, $1, $2)
var %total $round($calc((%num * 20) / $1),1)
echo -a TOTAL:7 $1 1VALUE:7 $2
echo -a PERCENTAGE: $str(4|1,%total) $+ $str(|,$ceil($calc(20 - %total))) %percent
}