Enhancement Request
Explain your enhancement (please be detailed)
Add a third parameter to edd_format_discount_rate() and pass it to edd_format_amount(). This would allow us to format discount rates without decimals. Something like:
/**
* Format Discount Rate
*
* @since 1.0
* @param string $type Discount code type
* @param string|int $amount Discount code amount
* @param string $decimals Default true. Whether or not to use decimals.
* @return string $amount Formatted amount
*/
function edd_format_discount_rate( $type = '', $amount = '', $decimals = true ) {
return ( 'flat' === $type )
? edd_currency_filter( edd_format_amount( $amount, $decimals ) )
: edd_format_amount( $amount, $decimals ) . '%';
}
Justification or use case
We show discount percentages as "10%", not "10.00%".
Enhancement Request
Explain your enhancement (please be detailed)
Add a third parameter to edd_format_discount_rate() and pass it to
edd_format_amount(). This would allow us to format discount rates without decimals. Something like:Justification or use case
We show discount percentages as "10%", not "10.00%".