<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">The 3.9 docs show a padding function<br>
<br>
$(padding <macro> <prepended characters>)<br>
<br>
but the examples show a length argument<br>
<br>
$(padding $MESSAGE 10 X): bar<br>
would produce a result of XXXXXXXbar<br>
<br>
but that is unclear. Where does $MESSAGE go? Does $MESSAGE get
populated with XXXXXXXbar<br>
<br>
<br>
So maybe it could be written<br>
<br>
$(padding $min_slice 2 "0"): $(* $(/ $R_MIN 5) 5)<br>
<br>
<br>
There is some way to do it, but I can't figure it out from the
docs.<br>
<br>
Evan.<br>
<br>
<br>
On 05/10/2017 09:39 PM, Scheidler, Balázs wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANWQT2O-5w5m9DFOKE1ijrcrbX0npgFgE8wrz=DyxX=ZcqzHUw@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="auto">Yes, you can also combine the first two:
<div dir="auto"><br>
</div>
<div dir="auto">$(* $(/ $R_MIN 5) 5)</div>
<div dir="auto"><br>
</div>
<div dir="auto">It would be nice to have a template function
that does the padding, but right now we dont have that. In
that case it could be like this:</div>
<div dir="auto"><br>
</div>
<div dir="auto">$(str-pad --width 2 --right --pad 0 <span
style="font-family:sans-serif">$(* $(/ $R_MIN 5) 5))</span></div>
<br>
<div dir="auto">Or something like that. A specialized template
function that does exactly this could also br useful:</div>
<div dir="auto"><br>
</div>
<div dir="auto">$(slice $R_MIN 5)</div>
<div dir="auto"><br>
</div>
<div dir="auto">Although the naming can be tricky (I don't think
slice conveys the meaning well enough).</div>
<div dir="auto"><br>
</div>
<div dir="auto">Creating a simple template function is not too
difficult, just look at the basicfuncs module.</div>
<div dir="auto"><br>
</div>
<div dir="auto">One with arguments is more difficult though.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Bazsi</div>
</div>
</blockquote>
<br>
</body>
</html>