city.php
4 days ago
country.php
4 days ago
currency.php
4 days ago
date.php
4 days ago
empgroup.php
4 days ago
employee.php
4 days ago
group.php
4 days ago
index.html
4 days ago
optiongroup.php
4 days ago
service.php
4 days ago
state.php
4 days ago
user.php
4 days ago
currency.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | /** |
| 15 | * Formats the given float into a formatted currency. |
| 16 | * |
| 17 | * @since 1.7 |
| 18 | */ |
| 19 | class ImportColumnCurrency extends ImportColumn |
| 20 | { |
| 21 | /** |
| 22 | * Helper method used to format the values under this column. |
| 23 | * |
| 24 | * @param mixed $value The default column value. |
| 25 | * |
| 26 | * @return string The formatted value |
| 27 | */ |
| 28 | public function format($value) |
| 29 | { |
| 30 | // format with parent first |
| 31 | $amount = parent::format($value); |
| 32 | |
| 33 | if ($value != $amount) |
| 34 | { |
| 35 | // value has been manipulated by the parent, |
| 36 | // we don't need to go ahead |
| 37 | return $amount; |
| 38 | } |
| 39 | |
| 40 | // format as currency |
| 41 | $amount = VAPFactory::getCurrency()->format($amount); |
| 42 | |
| 43 | return $amount; |
| 44 | } |
| 45 | } |
| 46 |