Code Duplication    Length = 19-20 lines in 2 locations

includes/formatting.php 1 location

@@ 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

includes/currency-functions.php 1 location

@@ 1790-1808 (lines=19) @@
1787
 *
1788
 * @return string           The symbol to use for the currency
1789
 */
1790
function give_currency_symbol( $currency = '', $decode_currency = false ) {
1791
1792
	if ( empty( $currency ) ) {
1793
		$currency = give_get_currency();
1794
	}
1795
1796
	$currencies = give_currency_symbols( $decode_currency );
1797
	$symbol     = array_key_exists( $currency, $currencies ) ? $currencies[ $currency ] : $currency;
1798
1799
	/**
1800
	 * Filter the currency symbol
1801
	 *
1802
	 * @since 1.0
1803
	 *
1804
	 * @param string $symbol
1805
	 * @param string $currency
1806
	 */
1807
	return apply_filters( 'give_currency_symbol', $symbol, $currency );
1808
}
1809
1810
1811
/**