This commit is contained in:
AlexBa16
2026-06-08 15:29:52 +02:00
commit 27903eed4a
9931 changed files with 1535659 additions and 0 deletions
@@ -0,0 +1,32 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage Fields.Number
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$value = $field->value;
$min = $field->fieldparams->get('min', null);
$currency = $field->fieldparams->get('currency', 0);
$decimals = $field->fieldparams->get('decimals', 2);
$symbol = $field->fieldparams->get('symbol', '');
$position = $field->fieldparams->get('position', 0);
if (is_numeric($value)) {
$value = (float)$value;
if ($currency) {
$formattedCurrency = number_format($value, $decimals, Text::_('DECIMALS_SEPARATOR'), Text::_('THOUSANDS_SEPARATOR'));
$value = $position ? ($formattedCurrency . $symbol) : ($symbol . $formattedCurrency) ;
}
} else {
$value = $min ?? '';
}
echo $value;