Jump to content

formatCurrency() not working


Eduardo G.

Recommended Posts

Hi all, I have a (maybe silly) question about formatCurrency() function as I want to use it from a custom addon.

I've configured my only currecy euro as shown on attachment.

When I run this code:

	$value = '4.40';	echo "value is: " . formatCurrency($value) . "<br>\n";
$value = '4,40';	echo "value is: " . formatCurrency($value) . "<br>\n";
$value = '4';	   echo "value is: " . formatCurrency($value) . "<br>\n";

 

I get this output:

value is: 4
value is: 4
value is: 4

 

I'm using it from a custom function inside a custom addon.

What am I doing wrong with this function?

P.S. using latest 5.1.2

Thanks.

currencies.png

Link to comment
Share on other sites

Thanks. I get nothing new :-(

As documentation says: "You must call the first function first unless you are only wanting to display a value in the default system currency." and that's exactly what I want.

Even using that line above, I get exactly same input.

I don't know where the mistake is :-(

Link to comment
Share on other sites

I did some quick tests and it looks like this function only works properly in the client area but if you try and call this function and your outputting data to the admin area it doesn't work.

 

I would recommend opening a ticket with WHMCS and see if this is a workaround or if they can fix it.

Link to comment
Share on other sites

  • 6 months later...
  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated