| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
// Currency Settings Helper Functions |
| 7 |
function easy_invoice_get_currency_code() { |
| 8 |
return get_option('easy_invoice_currency_code', 'USD'); |
| 9 |
} |
| 10 |
|
| 11 |
function easy_invoice_get_currency_position() { |
| 12 |
return get_option('easy_invoice_currency_position', 'left'); |
| 13 |
} |
| 14 |
|
| 15 |
function easy_invoice_get_currency_symbol_type() { |
| 16 |
return get_option('easy_invoice_currency_symbol_type', 'symbol'); |
| 17 |
} |
| 18 |
|
| 19 |
function easy_invoice_get_currency_symbol() { |
| 20 |
$currency_code = easy_invoice_get_currency_code(); |
| 21 |
$currency_symbol_type = easy_invoice_get_currency_symbol_type(); |
| 22 |
|
| 23 |
if ($currency_symbol_type === 'code') { |
| 24 |
return $currency_code; |
| 25 |
} |
| 26 |
|
| 27 |
return \EasyInvoice\Helpers\CurrencyHelper::getCurrencySymbol($currency_code); |
| 28 |
} |
| 29 |
|
| 30 |
function easy_invoice_get_thousands_separator() { |
| 31 |
return get_option('easy_invoice_thousands_separator', ','); |
| 32 |
} |
| 33 |
|
| 34 |
function easy_invoice_get_decimal_separator() { |
| 35 |
return get_option('easy_invoice_decimal_separator', '.'); |
| 36 |
} |
| 37 |
|
| 38 |
function easy_invoice_get_decimal_precision() { |
| 39 |
return intval(get_option('easy_invoice_decimal_precision', 2)); |
| 40 |
} |