priceInBTC method

double priceInBTC({
  1. double min = 0.0,
  2. double max = 2.0,
})

Returns a random price in BTC.

min is optional minimum value of price (default is 0).

max is optional maximum value of price (default is 2).

Example:

Finance().priceInBTC(); // 0.9743798
Finance().priceInBTC(min: 10.0, max: 15.0); // 14.6666517

Implementation

double priceInBTC({double min = 0.0, double max = 2.0}) {
  return .parse(
    (Random(seed).nextDouble() * (max - min) + min).toStringAsFixed(7),
  );
}