Code Duplication    Length = 3-4 lines in 3 locations

core/helpers/EEH_Money.helper.php 2 locations

@@ 169-171 (lines=3) @@
166
		//if CNT_ISO passed lets try to get currency settings for it.
167
		$currency_config = $CNT_ISO !== '' ? new EE_Currency_Config( $CNT_ISO ) : null;
168
		//default currency settings for site if not set
169
		if ( ! $currency_config instanceof EE_Currency_Config ) {
170
			$currency_config = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config ? EE_Registry::instance()->CFG->currency : new EE_Currency_Config();
171
		}
172
173
		$decimal_places_placeholder = str_pad( '', $currency_config->dec_plc, '0' );
174
@@ 142-144 (lines=3) @@
139
		//if CNT_ISO passed lets try to get currency settings for it.
140
		$currency_config = $CNT_ISO !== '' ? new EE_Currency_Config( $CNT_ISO ) : null;
141
		//default currency settings for site if not set
142
		if ( ! $currency_config instanceof EE_Currency_Config ) {
143
			$currency_config = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config ? EE_Registry::instance()->CFG->currency : new EE_Currency_Config();
144
		}
145
146
		//first get the decimal place and number of places
147
		$format = "%'." . $currency_config->dec_plc . $format;

core/helpers/EEH_Template.helper.php 1 location

@@ 461-464 (lines=4) @@
458
            // was a country ISO code passed ? if so generate currency config object for that country
459
            $mny = $CNT_ISO !== '' ? new EE_Currency_Config($CNT_ISO) : null;
460
            // verify results
461
            if ( ! $mny instanceof EE_Currency_Config) {
462
                // set default config country currency settings
463
                $mny = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config
464
                    ? EE_Registry::instance()->CFG->currency
465
                    : new EE_Currency_Config();
466
            }
467
            // format float