Verbat Posted January 23, 2008 Share Posted January 23, 2008 If i want the rand option to generate numbers with . in it how can i do it? For example, i want it to rand numbers between 3.5 and 4.3 everything in this range. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/87379-solved-rand-question/ Share on other sites More sharing options...
ziv Posted January 23, 2008 Share Posted January 23, 2008 everything in this range? 3.668667446 is ok? you can use rnad() on 3500 to 4300 and divide the result by 1000 (and you can do the same thing for any other size...) Quote Link to comment https://forums.phpfreaks.com/topic/87379-solved-rand-question/#findComment-446968 Share on other sites More sharing options...
Verbat Posted January 23, 2008 Author Share Posted January 23, 2008 everything in this range? 3.668667446 is ok? you can use rnad() on 3500 to 4300 and divide the result by 1000 (and you can do the same thing for any other size...) Ye, you are right not everything just with one digit after the . but i didnt think of just deviding it buy 1000 Thanks man. Quote Link to comment https://forums.phpfreaks.com/topic/87379-solved-rand-question/#findComment-446973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.