Description
The RandomMoneyGen Generator randomly generates money in whole part and fractional part.
In This Article
- Generator Parameters
- Example 1 - Generate Money Amounts with Decimal Value Ranging from 0 to 99
- Example 2 - Generate Values Ranging from -100 to 100 with Signs Included
Generator Parameters
The following parameters may be configured for the RandomMoneyGen Generator. Items with an asterisk* are required.
- startRange* - Enter the starting range whole part of the number.
- endRange* - Enter the ending range whole part of the number.
- decimalFormat* - Defines the format for the decimal number.
- includeDecimal* - Determines whether to include the decimal in the output value or not.
- fraction* - Defines the fractional amount that will be generated for the whole.
- includeSign*- Determines whether to include the sign in the output value. There are four options:
- NEVER - Do not include the sign at all.
- ALWAYS - Always include the sign, whether positive or negative, in front of the output value.
- POSITIVE_ONLY - Only include the Positive Signs in front of output value. Negative output values will have no sign.
- NEGATIVE_ONLY - Only include the Negative Signs in front of output value. Positive output values will have no sign.
- padLength* - If the value is greater than zero, it defines how many zeros should be padded to the left (e.g., if padLength = 10, then 120024 -> 0000120024).
- seed - Defines an optional seed for randomization.
Example 1 - Generate Money Amounts with Decimal Value Ranging from 0 to 99
Sample Output
Example 2 - Generate Values Ranging from -100 to 100 with Signs Included
Sample Output