PHP money_format to Swiss Currency

In my PHP file, I have this code:

setlocale(LC_MONETARY, 'de_CH');

and further down:

money_format('%.2n')

My local site adjusts correctly according to my "setLocal"-setting, but on the remote site on my linode, I keep getting the $-sign instead of € or Fr. (for Switzerland), no matter what.

How do I get the correct currency to show?

1 Reply

This seems to suggest you don't have the locale for de_CH installed on the Linode, which would be necessary to reference it in PHP code.

If you run locale -a, you should be able to determine if the corresponding locale is installed.

If it's not installed, running /usr/share/locales/install-language-pack de_CH (this might vary depending on your system - reply if it doesn't work) should get you up and running.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct