Generating Random Numbers in Mathematica 0-1 (2 Decimal Places)

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
jemma
Messages
35
Reaction score
0
I want to use the random number generator in mathematica to give me numbers in the range of 0 to 1, but only to two decimal places. Can anyone help?
Thanks.
 
Physics news on Phys.org
You can perhaps you Round, as in Round[RandomReal[1, 10], 0.01].

Note, that functions like RandomReal has an option called WorkingPrecision, which I guess should only be used when you want to increase the number of digits over the standard 6, and not when you want to decrease the number, unless you know for sure that this will not alter the distribution of the generated numbers (I am not able to see that in the documentation).