doubleR function
return a double between min
to max
.
decimal
is double retain decimal places.
because of the naming conflict, I added an 'R' letter.
Implementation
double doubleR({int min = 0, int max = 1, int decimal = -1}) {
final result = _random.nextDouble() * (max - min) + min;
return decimal < 0 ? result : double.parse(result.toStringAsFixed(decimal));
}