@Float()
New in 2.0Generate random float values (4 bytes)
Data TypesSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| min | — | — | Minimum value, default 0.0 | |
| max | — | — | Maximum value, default 3.40282346638528860e+38 | |
| scale | — | — | Precision digits, default 2 | |
| nullSampler | — | — | The null ratio, such as "1:2", indicates that generating a random value 3 times with an average of 1 time is null |
Usage
@Float(arg0,arg1,arg2,arg3)Full parameter constructor, see complete parameter documentation
Example:
@Float(0,10,5,1:2)
Output:
1.22222@Float(arg0,arg1,arg2)Generate random float between min and max with specified precision
Example:
@Float(5,15,2)
Output:
5.22@Float(arg0)Generate random float between 0 and 3.40282346638528860e+38 with specified precision
Example:
@Float(5)
Output:
87901.011273092290435.18326@Float()Generate random float between 0 and 3.40282346638528860e+38
Example:
@Float()
Output:
1.2222222@Float(arg0)Generate random float between 0 and 3.40282346638528860e+38 with null ratio
Example:
@Float(1:2)
Output:
1.2222222@Float(arg0,arg1)Generate random float between min and max
Example:
@Float(5,15)
Output:
5.2222222