mIRC Home    About    Download    Register    News    Help

Print Thread
getting randnum w/ decimals... #250575 22/01/15 08:55 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
i wanna use
Code:
var %num = %rand(0.5,3)


bit I need decimals as well for results

like 1.6 or 2.1 or 0.8 etc

Re: getting randnum w/ decimals... [Re: HappyFappy] #250577 22/01/15 09:35 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
var %num $calc(%rand(0,2) + ($rand(0,10) / 10))
or
var %num $calc(%rand(0,30) / 10)

Last edited by Belhifet; 22/01/15 09:37 AM.
Re: getting randnum w/ decimals... [Re: Belhifet] #250579 22/01/15 09:56 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
it just keeps coming back as 0

Re: getting randnum w/ decimals... [Re: HappyFappy] #250582 22/01/15 10:35 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
var %num $calc($rand(0,2) + ($rand(0,10) / 10))
or
var %num $calc($rand(0,30) / 10)

whoops, copied your original post smile

Last edited by Belhifet; 22/01/15 10:35 AM.