Re: generating random percentage

Sean McAfee <[email protected]> Wed, 2 Apr 2014 12:29:10 -0700
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <CANan03a5v6WPDJ9E4pa2F=2o3tX3=_Ub9ih0Sus5P=-S9m8Uyw@mail.gmail.com>
On Wed, Apr 2, 2014 at 12:20 PM, Summer <crazysummer2004-/[email protected]> wrote:

> I am really looking for a way to generate a random number, whole, from 0 -
> 100. I look thru the docs, don't see anything.
>
>
You want the Math module.  This template snippet will output a whole number
between 0 to 99 inclusive:

[% USE Math; Math.int(Math.rand(100)) %]

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates