Author Topic: error in number_format() with php 5.3.3 in nbill.number.format.php  (Read 3986 times)

Offline Brock Palen

  • Full Member
  • ***
  • Posts: 29
    • View Profile
When adding new expenses I get an error email from nbill:

User ID: 63
Software Version: 2.0.9
Domain: http://www.########.com
Date/Time: 30-Nov-2010 03:11:04 pm
IP Address:  ############
Page: /administrator/index2.php?option=com_nbill
Referrer: http://www.########.com/administrator/index2.php?option=com_nbill&action=expenditure&task=edit&cid=93&search_date_from=12/01/2009&search_date_to=11/30/2010&pyt_no_search=&paid_to_search=&pyt_amount_search=
Error Log ID: 23
Error Message: number_format() expects parameter 1 to be double, string given
File Name: ############/administrator/components/com_nbill/framework/nbill.number.format.php
Line Number: 71
PHP Version (and OS): 5.3.3-pl1-gentoo (Linux)
CMS: Joomla!

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: error in number_format() with php 5.3.3 in nbill.number.format.php
« Reply #1 on: 30/November/2010, 08:33:29 PM »
Pesky PHP 5.3!

To resolve this, you will need to edit the file /administrator/components/com_nbill/framework/nbill.number.format.php around line 71, where it says:

$ret_val = number_format($ret_val, $decimal_places, ".", $thousands);

...replace that with:

$ret_val = number_format((double)$ret_val, $decimal_places, ".", $thousands);

The fix will be included in the next release.

Offline Brock Palen

  • Full Member
  • ***
  • Posts: 29
    • View Profile
Re: error in number_format() with php 5.3.3 in nbill.number.format.php
« Reply #2 on: 30/November/2010, 08:38:50 PM »
Thank you for the quick resolution!