| @@ 95-114 (lines=20) @@ | ||
| 92 | * |
|
| 93 | * @return mixed |
|
| 94 | */ |
|
| 95 | function give_get_price_decimals( $id_or_currency_code = null ) { |
|
| 96 | // Set currency on basis of donation id. |
|
| 97 | if ( empty( $id_or_currency_code ) ) { |
|
| 98 | $id_or_currency_code = give_get_currency(); |
|
| 99 | } |
|
| 100 | ||
| 101 | $number_of_decimals = 0; |
|
| 102 | ||
| 103 | if ( ! give_is_zero_based_currency( $id_or_currency_code ) ) { |
|
| 104 | $setting = give_get_currency_formatting_settings( $id_or_currency_code ); |
|
| 105 | $number_of_decimals = $setting['number_decimals']; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * Filter the number of decimals |
|
| 110 | * |
|
| 111 | * @since 1.6 |
|
| 112 | */ |
|
| 113 | return apply_filters( 'give_sanitize_amount_decimals', $number_of_decimals, $id_or_currency_code ); |
|
| 114 | } |
|
| 115 | ||
| 116 | /** |
|
| 117 | * Get thousand separator |
|
| @@ 169-187 (lines=19) @@ | ||
| 166 | * |
|
| 167 | * @return string The symbol to use for the currency |
|
| 168 | */ |
|
| 169 | function give_currency_symbol( $currency = '', $decode_currency = false ) { |
|
| 170 | ||
| 171 | if ( empty( $currency ) ) { |
|
| 172 | $currency = give_get_currency(); |
|
| 173 | } |
|
| 174 | ||
| 175 | $currencies = give_currency_symbols( $decode_currency ); |
|
| 176 | $symbol = array_key_exists( $currency, $currencies ) ? $currencies[ $currency ] : $currency; |
|
| 177 | ||
| 178 | /** |
|
| 179 | * Filter the currency symbol |
|
| 180 | * |
|
| 181 | * @since 1.0 |
|
| 182 | * |
|
| 183 | * @param string $symbol |
|
| 184 | * @param string $currency |
|
| 185 | */ |
|
| 186 | return apply_filters( 'give_currency_symbol', $symbol, $currency ); |
|
| 187 | } |
|
| 188 | ||
| 189 | ||
| 190 | /** |
|