| @@ 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; |
|
| @@ 427-430 (lines=4) @@ | ||
| 424 | // was a country ISO code passed ? if so generate currency config object for that country |
|
| 425 | $mny = $CNT_ISO !== '' ? new EE_Currency_Config( $CNT_ISO ) : NULL; |
|
| 426 | // verify results |
|
| 427 | if ( ! $mny instanceof EE_Currency_Config ) { |
|
| 428 | // set default config country currency settings |
|
| 429 | $mny = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config ? EE_Registry::instance()->CFG->currency : new EE_Currency_Config(); |
|
| 430 | } |
|
| 431 | // format float |
|
| 432 | $amount_formatted = number_format( $amount, $mny->dec_plc, $mny->dec_mrk, $mny->thsnds ); |
|
| 433 | // add formatting ? |
|