Tribe__Tickets__Commerce__Currency::get_number_of_decimals( string|null $provider = null )
Get the Number of Decimals by provider or default.
Contents
Parameters
- $provider
-
(string|null) (Optional) The ticket provider class name.
Default value: null
Return
(string) The thousands separator.
Source
File: src/Tribe/Commerce/Currency.php
public function get_number_of_decimals( $provider = null ) {
if ( ! class_exists( $provider ) ) {
return $this->get_currency_number_of_decimals();
}
if ( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' === $provider ) {
return get_option( 'woocommerce_price_num_decimals' );
}
if ( 'Tribe__Tickets_Plus__Commerce__EDD__Main' === $provider ) {
/**
* Filter the Amount of Decimals for EDD.
*
* @since 4.11.0
*
* @param int The default number of decimals.
*/
$decimals = apply_filters( 'tribe_edd_format_amount_decimals', 2 );
return $decimals;
}
return $this->get_currency_number_of_decimals();
}
Changelog
| Version | Description |
|---|---|
| 4.11.0 | Introduced. |