javascript - Get a random number between 0.0200 and 0.120 (float numbers) -


this question has answer here:

i need create random number between 0.0200 , 0.120 using javascript. how this?

you use

(math.random() * (0.120 - 0.0200) + 0.0200).tofixed(4) 

tofixed(n) used convert number string, keeping "n" decimals.

hope helps ^_^


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -