jjay@aus wrote:
Does anyone have any suggestions on how I can randomly adjust a
number (e.g.300,000) in a range between 1% increase and 2%
decrease?
The Coldfusion function rand() returns a real number, that
is, a decimal number, between 0 and 1 at random. Therefore,
3*rand() is a random real number between 0 and 3. It follows that
98+3*rand() is a random real number between 98 and 101. Hence,
98+3*rand() is the factor you seek.
However, you have to divide it by 100. For example, a
decrease of 2% is equivalent to 98% or 0.98 of the original value.
An increase of 1% is equivalent to 101% or 1.01 of the original
value. The code follows.