$padnum()
mIRC Code
+ 2 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | Jun 29, 2009 |
| Last Updated | Jun 29, 2009 |
| Tags | knoeki num number pad padding padnum prefix zomgwtfbbq zowb |
Introduction
I wrote this just because I happened to need this a few times.
It doesn\'t do much, but what it does do, it does right. (confused yet? :_)). It takes two numbers, a low and a high, and returns the low number prefixed with as many zeros as needed to get the same length as the high number. purely for visual pleasure when making long numbered lists or something like that, since it will align nicely.
Usage:
$padnum(low, high, <s>)
if you specify \'s\', it will add the zeroes to the end, rather than in front.
mIRC Snippet:
$padnum()
Posted on Jun 29, 2009 5:46 pm
Posted on Jun 29, 2009 5:46 pm
Just for reference, check out $base too, it\'s helpful for the same function however using it can be quite tricky this simplifies it a hell of a lot. Here\'s a slightly shorter version for you :)
| Code: |
| alias padnum return $+($iif($3 == s,$1),$str(0, $calc($len($2) - $len($1))),$iif($3 != s,$1)) |








