Percentage

By chorao on Jan 08, 2011

Screenshots

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
}

Comments

Sign in to comment.
Back2Life   -  Jan 09, 2011

You may want to tell us to put it in the alias section, or edit the beginning to

 alias percent { 

Well, all pointless complaints aside, it works good for what it does, I guess.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.