How can I generate random "decimals" in C#? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

How can I generate random "decimals" in C#?

5th Feb 2019, 3:37 PM
Alex
2 Respuestas
+ 2
Did a little search on google and did find 3 methods. 1) divide a integer generated value by 100 2) generate the integer part and the decimal part separately and concatenate in a string. 3) rnd.NextDouble() (where rnd is your random - object) I haven't used it myself, but you can try one of these methods http://csharpindepth.com/Articles/Chapter12/Random.aspx
6th Feb 2019, 8:18 PM
sneeze
sneeze - avatar
0
sneeze Thank U so much!!
7th Feb 2019, 10:49 AM
Alex