Code Duplication    Length = 19-20 lines in 2 locations

includes/currency-functions.php 1 location

@@ 942-960 (lines=19) @@
939
 *
940
 * @return string           The symbol to use for the currency
941
 */
942
function give_currency_symbol( $currency = '', $decode_currency = false ) {
943
944
	if ( empty( $currency ) ) {
945
		$currency = give_get_currency();
946
	}
947
948
	$currencies = give_currency_symbols( $decode_currency );
949
	$symbol     = array_key_exists( $currency, $currencies ) ? $currencies[ $currency ] : $currency;
950
951
	/**
952
	 * Filter the currency symbol
953
	 *
954
	 * @since 1.0
955
	 *
956
	 * @param string $symbol
957
	 * @param string $currency
958
	 */
959
	return apply_filters( 'give_currency_symbol', $symbol, $currency );
960
}
961
962
963
/**

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