SeparatorThousand=' not allowed? Howto enquote?

[Dolibarr 3.3.1]

In the main.lang, I have set the SeparatorThousand=’ (=Aphostrophe).

Dolibarr convert it to the Ampersand character. This looks very ugly on my invoices and creates prices like 1&234.56 instead of 1’234.56

Is there any possibility to enquote this ’ sign?
Other special characters, like the similar ` (Grave accent) sign, would work, but are not a real solution.

How can I use the familiar Apostrophe as separator for numbers bigger then 999?

try to escape it with \ or / or // or \ maybe ? i’m really not sure of the result so backup your DB first :happy:

Thank you for all your help!

Unfortunately, none of this suggestions works.
You can easily check it:
a) Change this line in your main.lang to SeparatorThousand='
b) Call http://IP-of-your-Server/dolibarr/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info

You can see the results immediatly like this:

=> price2num(1233.56+1) 1 => price2num('1//'234.56') 1/234.56 => price2num('1 234.56') 1/234.56 => price(1234.56) 1/234.56

The expected result is:
1’234.56
and
1’234’567.89

hello,
i dont understand why you use a quote as a thousand separator; i dont think many softwares handle this…

This is the official syntax for Switzerland :wink:

I don’t know any other software that has a problem with an apostroph. EVERY sign should be possible using some similar command to the php htmlspecialchars internally :blush:

What I found so far:
I can calculate my single products correctly if I use the mentioned ` (Grave accent) sign as SeparatorThousand.

If I change the SeparatorThousand to the desired ’ (Apostrophe) and then patch the function price in the function.lib.php with something like this around line 2972

if ($thousand === " & # 0 3 9 ; ") $output=number_format($amount, $nbdecimal, $dec, "'");I get the numbers correctly, even in a new calculated PDF invoice.

BUT
As soon as I recalculate a single product, the calculation goes wrong… :dry:

There must be an error with this special character ’ (Apostrophe, ASCII 39). The function price seems to get a html encoded entity & # 0 3 9 ; instead of the single character ’

Support for ’ will be available with 3.4

Thank you very much for this commit! It works great! :happy: