Definition
The random float transformer generates a random floating point number.
For example:
32.2432
By default, the random float transformer generates a floating point number with 2 digits before the decimal point and 3 digits after the decimal point.
Configurations
Depending on your validations, you may want to configure the output float. The random float transformer has the following configurations:
Name | Description | Default | Example Input | Example Output |
---|---|---|---|---|
Preserve Length | Preserves the length of the input float to the output float while maintaining the placement of the decimal. | false | 1.34 | 873.923 |
Digits before Decimal | Specifies how many digits you want before the decimal place. This has a max of 9 digits. | 2 | 23.24 | 94.17 |
Digits after Decimal | Specifies how many digits you want after the decimal place. This has a max of 9 digits. | 3 | 87923.4 | 34.8 |
Examples
There are several ways you can mix-and-match configurations to get different potential random float formats. Here are some possible combinations:
PreserveLength | Digits before Decimal | Digits after Decimal | Example Input | Example Output |
---|---|---|---|---|
false | N/A | N/A | 89.232 | 23.824 |
true | 4 | 1 | 2.344 | 9.813 |
true | 2 | 3 | 678.23 | 54.129 |