Generate random price in BTC.

        :param minimum: Minimum value of price.
        :param maximum: Maximum value of price.
        :return: Price in BTC.
551520
def price_in_btc(self, minimum: float = 0, maximum: float = 2) -> str:
        
        return '{} BTC'.format(
            self.random.uniform(
                minimum,
                maximum,
                precision=7,
            ),
        )
473965
def fee(self, value=None, unit='satoshi'):
        
        convert = None
        if not value:
            # no fee was specified, use $0.02 as default.
            convert = get_current_price(self.crypto, "usd")
            self.fee_satoshi = int(0.02 / convert * 1e8)
            verbose = "Using default fee of:"

        elif value == 'optimal':
            self.fee_satoshi = get_optimal_fee(
                self.crypto, self.estimate_size(), verbose=self.verbose
            )
            verbose = "Using optimal fee of:"
        else:
            self.fee_satoshi = self.from_unit_to_satoshi(value, unit)
            verbose = "Using manually set fee of:"

        if self.verbose:
            if not convert:
                convert = get_current_price(self.crypto, "usd")
            fee_dollar = convert * self.fee_satoshi / 1e8
            print(verbose + " %s satoshis ($%.2f)" % (self.fee_satoshi, fee_dollar))
959237
public static int random(final int min, final int max) {
        return min + new java.security.SecureRandom().nextInt(max - min + 1);
    }
87293
public static long random(long min, long max) {
        return Math.round(ThreadLocalRandom.current().nextDouble()
                * (max - min) + min);
    }
1297389
public static function randNum($min = null, $max = null)
    {
        mt_srand((double) microtime() * 1000000);
        if ($min === null || $max === null) {
            return mt_rand();
        } else {
            return mt_rand($min, $max);
        }
    }
739938
private static function randFloat($min, $max, $decimals = 0.01)
    {
        $decimals = 1 / $decimals;

        return mt_rand($min * $decimals, $max * $decimals) / $decimals;
    }
811268
def get_last_available_price(self) -> PriceModel:
        
        price_db = PriceDbApplication()
        symbol = SecuritySymbol(self.security.namespace, self.security.mnemonic)
        result = price_db.get_latest_price(symbol)
        return result
691367
def credit_card_expiration_date(self, minimum: int = 16,
                                    maximum: int = 25) -> str:
        
        month = self.random.randint(1, 12)
        year = self.random.randint(minimum, maximum)
        return '{0:02d}/{1}'.format(month, year)
377220
def size(self, minimum: int = 1, maximum: int = 100) -> str:
        
        num = self.random.randint(minimum, maximum)
        unit = self.random.choice(
            ['bytes', 'kB', 'MB', 'GB', 'TB'])

        return '{num} {unit}'.format(
            num=num,
            unit=unit,
        )
1344396
def get_rand(num_digit_min, num_digit_max):
        
        buf = ""
        max_len = random.randint(num_digit_min, num_digit_max)
        for i in range(max_len):
            buf += str(random.randint(0, 9))
        return buf
1127783
def get_random_value(field):
    
    func = get_factory_func(field)

    if field.default is not None:
        if callable(field.default):
            return field.default()
        return field.default

    if field.choices:
        return random.choice(field.choices)

    return func(field)
217190
private static int getRolledValue(int value, int amount, int min, int max) {
        assert value >= min && value <= max;
        int range = max - min + 1;
        amount %= range;
        int n = value + amount;
        if (n > max) {
            n -= range;
        } else if (n < min) {
            n += range;
        }
        assert n >= min && n <= max;
        return n;
    }
1203703
def min_order_amount(self) -> Money:
        """"""
        return self._fetch('minimum order amount', self.market.code)(self._min_order_amount)()
290591
def getprice(self):
        
        target = self.bot.get("target", {})
        if target.get("reference") == "feed":
            assert self.market == self.market.core_quote_market(), "Wrong market for 'feed' reference!"
            ticker = self.market.ticker()
            price = ticker.get("quoteSettlement_price")
            assert abs(price["price"]) != float("inf"), "Check price feed of asset! (%s)" % str(price)
        return price
1331373
def maximum(self, value):
        
        self._remove_max()
        if value is None:
            return
        self._add_max(val=value)
158570
def marketPrice(self) -> float:
        
        price = self.last if (
            self.hasBidAsk() and self.bid <= self.last <= self.ask) else \
            self.midpoint()
        if isNan(price):
            price = self.close
        return price
1082312
public static void randomize(
        MutableDoubleTuple t, double min, double max, Random random)
    {
        double delta = max - min;
        for (int i=0; i<t.getSize(); i++)
        {
            t.set(i, min + random.nextDouble() * delta);
        }
    }