Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

JDOM Decimal Financial bug 02 Aug 2021 09:42 #15853

When trying to hide the cents with a fly finiancial decimal by setting decimal = 0, the code thinks that the decimal property is empty and defaults to 2 decimal places.

This is the code that should work to set the decimal in a financial decimal - but it will show 2 decimals.
echo JDom::_('html.fly.decimal.financial', array(
						'currencyFormat' => '$ %s',
                                                'decimals' => '0',
						'dataKey' => 'total_cost',
						'dataObject' => $row,
						'emptyZero' => true
					));

The bug is on line 52 of the libraries/jdom/html/fly/decimal/financial.php JDOM

Bad code:
if (empty($this->decimals))
			$this->decimals = 2;

This code needs to be
if (!isset($this->decimals))
			$this->decimals = 2;
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Last edit: by organicwebs. Reason: spelling!
  • Page:
  • 1
Time to create page: 0.093 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started