[pmwiki-users] Rand HexRand

Dominique Faure dominique.faure at gmail.com
Mon May 12 12:30:04 CDT 2008


On Sun, May 11, 2008 at 11:28 PM, Hans <design5 at softflow.co.uk> wrote:
>
> Saturday, May 10, 2008, 8:18:00 PM, Doug Parker wrote:
>
> > I know
>
> >    {(rand w x)}
>
> > will give me a random number from x to y. Can a hex random function
>
> >    {(hexrand #y #z)}
>
> > be created, or built off the rand function to generate random hex
> > values or digits?
>

The MarkupExprPlus recipe already provides the 'sprintf' function
which is able to format numbers the way you want, as in:

{(sprintf "%x" (rand 1 255))}

-- 
Dominique



More information about the pmwiki-users mailing list