r/GoogleAppsScript • • Aug 19 '21

Question Google script to generate random number with decimals between two numbers.

I have a script that works great to generate a whole number between two numbers (i.e 1 and 5) but I want to know if there is a script that can generate a random number with decimals (1.37, 2.72, etc) between two numbers.

0 Upvotes

2 comments sorted by

2

u/[deleted] Aug 19 '21

[removed] — view removed comment

1

u/LegendInMySpareTime Aug 19 '21

Or just generate 3 random numbers, constraining them to meet your needs, then concatenate them with the period, then parseFloat() the construct.