Jump to content

[SOLVED] Small Random Numbers


master82

Recommended Posts

I have tried to use:

rand(0.98,1.02);

to generate a random number between 0.98 and 1.02,

these will then be used to add/remove a random 2% off a value ($value = $value1*[random])

However, upon printing the random value it is always 0.

Any was to generate working small numbers? or maybe you know another way to randomly add/subtract 2% from a value?
Link to comment
https://forums.phpfreaks.com/topic/32732-solved-small-random-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.