wc_gzd_format_tax_rate_percentage

Format tax rate percentage for output in frontend.

Description

(string) wc_gzd_format_tax_rate_percentage( (float) $rate, (bool) $percent = false ); 

Returns (string)

Parameters (2)

0. $rate (float)
The rate.
1. $percent — Optional. (bool) => false
Show percentage after number

Usage

  1. if ( !function_exists( 'wc_gzd_format_tax_rate_percentage' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-core-functions.php'; 
  3.  
  4. // The rate. 
  5. $rate = null; 
  6.  
  7. // show percentage after number 
  8. $percent = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_gzd_format_tax_rate_percentage($rate, $percent); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-gzd-core-functions.php  
  1. function wc_gzd_format_tax_rate_percentage( $rate, $percent = false ) { 
  2. return str_replace( '.', ', ', wc_format_decimal( str_replace( '%', '', $rate ), true, true ) ) . ( $percent ? '%' : '' );