/ Published in: C#
Expand |
Embed | Plain Text
public static void generatoRandomDouble() { double r = random.NextDouble() * 100; // cut of all but 2 decimal places Console.WriteLine(r.ToString("#0.00")); // round the doube r= Math.Round(r, 2); Console.WriteLine(r); // use point "." as decimal point Console.WriteLine(r.ToString(CultureInfo.InvariantCulture.NumberFormat)); }
You need to login to post a comment.
