I got this function in JS
var number = Math.random() + "";
var r = number * 10000000000000;
I need the 100% same function in C# as I’m new to C# I’m having hard time getting a function for this in C# for people who are familer or not with JS Math.random() will generate a number between 0 to 1 similar to this (0.7740926130209118, 0.6105941028799862) and then I would like to multiply by 10000000000000 and we get something like “2647182801738.3813 <—This is what I need.
I thought about creating a 13 digits random number and another 4 digit random number and just add it like 13 digit + . + 4 digits. This of course is not ideal but I’m having issues with it as well.
Random random = new Random(); int randomNumber = random.Next(1000000000000, 9999999999999);
will give me errors about int, What I understand is I should use long? but when I change int to long it still looks like random function itself is INT? Well I’m already confused of what I have found online, So It will be great if you can help with this one and explain how does it work.
Haven’t tested but sounds like you need: