I want to generate 10 digit random number but random.next function take int arguments that take 9 digit value How can i convert
Asked
Active
Viewed 1,280 times
0
-
6You could create two 5-digit numbers and combine them.. – TaW Sep 14 '18 at 10:37
-
1See this https://stackoverflow.com/questions/6651554/random-number-in-long-range-is-this-the-way – Azar Shaikh Sep 14 '18 at 10:37
-
also, try long int instead of double – Lazar Nikolic Sep 14 '18 at 10:38
-
please don't post code as screenshot. There are [several good reasons NOT to do it](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question) – Mong Zhu Sep 14 '18 at 10:39
-
`double barcode = rnd.NextDouble() * 9000000000.0 + 1000000000.0;` – Dmitry Bychenko Sep 14 '18 at 10:41