maskDecimal.php
Table of Contents
Functions
- maskDecimal() : float
- Replaces a value with a random decimal in `[lower, upper]`.
Functions
maskDecimal()
Replaces a value with a random decimal in `[lower, upper]`.
maskDecimal([mixed $value = null ][, float $lower = -1.0 ][, float $upper = 1.0 ][, int $scale = 2 ]) : float
Implements the conventional decimal masker: the value is replaced whatever
its original type (string, boolean and null included), rounded to scale
fraction digits. The bounds are inclusive; they are swapped if given in the
wrong order.
Parameters
- $value : mixed = null
-
The original value (ignored — replaced wholesale).
- $lower : float = -1.0
-
Smallest value to return.
- $upper : float = 1.0
-
Largest value to return.
- $scale : int = 2
-
Maximum number of fraction digits.