wc_gzd_format_tax_rate_percentage
Format tax rate percentage for output in frontend.
Description
Returns (string)
Parameters (2)
- 0. $rate (float)
- The rate.
- 1. $percent — Optional. (bool) =>
false
- Show percentage after number
Usage
if ( !function_exists( 'wc_gzd_format_tax_rate_percentage' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-core-functions.php'; } // The rate. $rate = null; // show percentage after number $percent = false; // NOTICE! Understand what this does before running. $result = wc_gzd_format_tax_rate_percentage($rate, $percent);
Defined (1)
The function is defined in the following location(s).
- /includes/wc-gzd-core-functions.php
- function wc_gzd_format_tax_rate_percentage( $rate, $percent = false ) {
- return str_replace( '.', ', ', wc_format_decimal( str_replace( '%', '', $rate ), true, true ) ) . ( $percent ? '%' : '' );
- }