You need to sign in to do that
Don't have an account?

hope to get random number
hi
i'm developing a calculation application.
i hope to get a random number
and display it in a visualforce page by using an apex controller or some class.
could anybody tell me a code to get a random number?
Use this
public double getRandomNumber() {
return Math.random();
}
this returns a random value between 0 and 1.
If you need a larger value you can multiply it by a larger number.
All Answers
Use this
public double getRandomNumber() {
return Math.random();
}
this returns a random value between 0 and 1.
If you need a larger value you can multiply it by a larger number.
hi,prageeth
thank you for your reply.
this solved my problem.