[Remind-Fans] Leading zeros

Paul Pelzl pelzlpj at eecs.umich.edu
Fri Jul 7 00:14:52 EDT 2006


On Fri, Jul 07, 2006 at 02:59:36AM +0100, Dougie Lawson wrote:
> Is there an easy way to get leading zeros on the monnum(d_date) and
> day(d_date) functions?

There's nothing really elegant that I can see...


> Or would I need to do that with a choose() function? And, if so, how
> would I do that?

You could probably use choose(), but I'd do something along these lines:

   FSET _pad2(i_int) iif(i_int > 9, coerce("STRING", i_int), "0" + coerce("STRING", i_int))
   REM MSG Something happens on [_pad2(monnum(trigdate()))]/[_pad2(day(trigdate()))]

Of course, unless you're trying to do something out of the ordinary, the
substitution filter is the way to go:

   REM 15 MSG Something happens on %t/%r

Paul





More information about the Remind-fans mailing list