Random Number Generator?

Joel Trauger's Avatar

Joel Trauger

14 Aug, 2014 08:02 PM

I know that traditional Apache Velocity has a Mathtool and is accessed via $math. function() .

Is there a way to do this in Cascade such that #set ( $number = $math.add(1, 1) ) followed by ${number} will give a result of 2?

This would greatly help with presenting a fresh and dynamic webpage to the viewer each time they look at it if we could choose random blocks that have been filled out with a data definition.

  1. 1 Posted by Ryan Griffith on 14 Aug, 2014 08:19 PM

    Ryan Griffith's Avatar

    Hi Joel,

    There is a Math Tool available for Velocity Formats, which I believe is what you are looking for. For additional documentation, feel free to check out this page.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Joel Trauger on 14 Aug, 2014 08:29 PM

    Joel Trauger's Avatar

    This is exactly what I needed. Thanks. I was unaware that it was prefixed with `$_Mathtool`. This helps a lot.

    Joel Trauger
    Webmaster
    Office of Marketing and Communications
    Henderson State University<http://www.hsu.edu>
    Box 7823 • Arkadelphia, AR 71999-0001
    870-230-5356

  3. 3 Posted by Ryan Griffith on 15 Aug, 2014 12:52 PM

    Ryan Griffith's Avatar

    Not a problem at all, Joel, I am glad to hear I was able to help out. I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  4. Ryan Griffith closed this discussion on 15 Aug, 2014 12:52 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac