We’re with you. JoomShaper is offering a 20% Discount on all plans due to the impact of COVID-19.

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Fatal error: Call to undefined function money_format()

Featured Lock Resolved Issue
hi, I installed the template educon but in front end you see

Fatal error: Call to undefined function money_format() in C:\xampp\htdocs\finotti2\components\com_splms\helpers\helper.php on line 176

Web Server: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.19

Thank you

6 Answers

Arun Sasi

More than a month ago #Permalink
Hi,

if you are using windows based system then you will not have this function available.

The function money_format() is only defined if the system has strfmon capabilities. For example, Windows does not, so money_format() is undefined in Windows.

http://www.php.net/manual/en/function.money-format.php

Thanks
Arun

riccardo

More than a month ago #Permalink
so I can not work in localhost? Is possible to disable the component?

thank you

Arun Sasi

More than a month ago #Permalink
Hi,

If you disable the component. LMS will not work.

Thanks
Arun

riccardo

More than a month ago #Permalink
Ah...ok...thank you

another solution ?

ait consulting

More than a month ago #Permalink
I deleted function (lines 171 to 177) and now it works

Shibbir

More than a month ago #Permalink
Hi there,

To use php money_format() functionality you need to use custom php function to do the job.

Please follow the instruction bellow :

1. Create a filename for e.g my-function.php in C:\xampp\htdocs\finotti2\components\com_splms\helpers\ folder. This file should contain following php code :


function alternative_money($val,$symbol='$',$r=2) {

$n = $val;
$c = is_float($n) ? 1 : number_format($n,$r);
$d = '.';
$t = ',';
$sign = ($n < 0) ? '-' : '';
$i = $n=number_format(abs($n),$r);
$j = (($j = $i.length) > 3) ? $j % 3 : 0;

return $symbol.$sign .($j ? substr($i,0, $j) + $t : '').preg_replace('/(\d{3})(?=\d)/',"$1" + $t,substr($i,$j)) ;

}


2, Open helper.php file and add this line


require_once('my-function.php');


3. Now at line number 173 and 176 just replace this money_format function name to this alternative_money

E.g: $result = alternative_money( '%!n ' . $currency[1], $amt);

Thanks.


There are no replies made for this post yet.
Be one of the first to reply to this post!

124

Templates

331230

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us