Random Number Mask
The Random Number mask shall generate random numbers for integers and and floating point numbers.
If the original number is a floating point number then the format of the masked value may be different to the original value. For example, if the original number was 91234567.89 then the masked value may be written in scientific notation instead such as 9.123456789E7. This should generally not be an issue because modern file parsers shall recognize both formats and will convert to the same internal numeric floating point number.
Minimum
This specifies the lower limit of the random number range. It can either be a number relative to the original number (as a percentage or explicit number), or an absolute number independent of the original data value.
The image above shows that the lower limit of the random number range shall be the original number minus 25 percent.
Lower limit
This specifies the minimum allowable value to be generated. If this field is left blank then there is no minimum limit.
If the original number is NULL/empty and the 'Original number and..' option is selected then NULL/empty shall be returned.
If the original number is NULL/empty and the 'Absolute number' option is selected for both Minimum and Maximum then a random number shall be generated unless the field's 'Preserve Nulls' setting is enabled.
Maximum
This specifies the upper limit of the random number range. It can either be a number relative to the original number (as a percentage or explicit number), or an absolute number independent of the original data value.
The image above shows that the upper limit of the random number range shall be the original number plus 25 percent.
Upper limit
This specifies the maximum allowable value to be generated. If this field is left blank then there is no minimum limit.
If the original number is NULL/empty and the 'Original number and..' option is selected then NULL/empty shall be returned.
If the original number is NULL/empty and the 'Absolute number' option is selected for both Minimum and Maximum then a random number shall be generated unless the field's 'Preserve Nulls' setting is enabled.
Scale
Same as original number
Integers
If the original number was an integer (i.e. did not contain a decimal point) then the result shall also be an integer.
Floating point numbers
If an original value contains a decimal point then the value shall be considered a floating point number.
Example: A value of 72.123 or "72.123" shall be considered having scale 3. FileMasker then generate a random number with up to 3 digits after the decimal place.
Digits
FileMasker shall calculate a random number with the specified number of digits in the fractional part.
If the original number was an integer (did not contain a decimal point) then the masked value shall also be an integer. Therefore this setting shall be ignored for input values that are integers.
Trailing zeroes in fractional part are trimmed
Trailing zeros in the fractional part are not included in the output.
For example, if the expected scale is 3 and the generated random number is 85.600 then this would be written as 85.6.
For string values that cannot be converted to a number
These options define how FileMasker is to respond to encountering an invalid number found in a string field.
For CSV files, all values are considered as strings on input regardless of whether or not they are enclosed within quotes.
For JSON files, only those values enclosed within quotes are considered as strings on input.
Report error
A runtime error shall be reported.
Replace with value
The specified value shall be used as the masked value. No warning or error is reported.
Replace with NULL
For JSON files, a NULL shall be written. If you want an empty value then use the 'Replace with value' option above and leave the value field blank. No warning or error is reported.
For CSV files an empty string shall be written. No warning or error is reported.
Preserve
The original value shall be preserved. No warning or error is reported
Other Considerations
Masked values generated by this mask shall synchronize (mask consistently) with the DataVeil Random Number mask for integers only and provided that the masks are deterministic and configured identically including using the same deterministic seed value. Masked values of original numbers that contain a decimal point will not synchronize between FileMasker and DataVeil.
