Random Number Generator
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2013 09:06 AM
I am looking to create a 4 digit random number generator for a variable. Is there a specific variable type I should use? Right now I have single line variable and when I put the below script in the default value, it generates the number but there is a decimal behind it.
javascript: Math.round(Math.random()*9000) + 1000;
Could anyone answer how to truncate the decimal and what is behind that? Or if there is an easier way to make a random integer pop up in a variable?
Thanks in advance.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2023 07:52 PM
How can I make sure, that this random vlaue will not be duplicated or repeat it self ?