Ejemplo n.º 1
0
/**
 * Return the multiplier for the currency. Most currencies are multiplied by 100. Zere decimal
 * currencies should not be multiplied so use 1.
 *
 * @param string $currency
 *
 * @since 2.5
 * @return int
 */
function rcp_stripe_get_currency_multiplier($currency = '')
{
    $multiplier = rcp_is_zero_decimal_currency($currency) ? 1 : 100;
    return apply_filters('rcp_stripe_get_currency_multiplier', $multiplier, $currency);
}
Ejemplo n.º 2
0
/**
 * Sets the number of decimal places based on the currency.
 *
 * @since  2.5.2
 * @param  int $decimals The number of decimal places. Default is 2.
 * @return int The number of decimal places.
 */
function rcp_currency_decimal_filter($decimals = 2)
{
    $currency = rcp_get_currency();
    if (rcp_is_zero_decimal_currency($currency)) {
        $decimals = 0;
    }
    return apply_filters('rcp_currency_decimal_filter', $decimals, $currency);
}