function currency_divide in Currency 7.2
Divdes one number by another.
Parameters
int|float|string $number_a: The number to divide.
int|float|string $number_b: The number to divide by.
Return value
int|float|string
3 calls to currency_divide()
- Currency::getRoundingStep in currency/
includes/ Currency.inc - Returns the rounding step.
- CurrencyExchangerBartFeenstraCurrency::load in currency/
includes/ CurrencyExchangerBartFeenstraCurrency.inc - Implements CurrencyExchangerInterface::load().
- CurrencyExchangerFixedRates::load in currency/
includes/ CurrencyExchangerFixedRates.inc - Implements CurrencyExchangerInterface::load().
File
- currency/
currency.module, line 1062 - Provides currency information and allows users to add custom currencies.
Code
function currency_divide($number_a, $number_b) {
if (extension_loaded('bcmath')) {
return bcdiv($number_a, $number_b, CURRENCY_BCMATH_SCALE);
}
else {
return $number_a / $number_b;
}
}