Welcome, Guest
Username: Password: Remember me

TOPIC: SeparatorThousand=' not allowed? Howto enquote?

SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22368

  • DolibarUser
  • DolibarUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 2
[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?
Last Edit: 1 year 8 months ago by DolibarUser.
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22383

  • HubZ
  • HubZ's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Thank you received: 1
  • Karma: 0
try to escape it with \ or / or // or \\ maybe ? i'm really not sure of the result so backup your DB first :)
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22393

  • DolibarUser
  • DolibarUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 2
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
Last Edit: 1 year 8 months ago by DolibarUser.
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22397

  • altatof
  • altatof's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 62
  • Thank you received: 1
  • Karma: 5
hello,
i dont understand why you use a quote as a thousand separator; i dont think many softwares handle this...
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22398

  • DolibarUser
  • DolibarUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 2
This is the official syntax for Switzerland ;)

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:
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22400

  • DolibarUser
  • DolibarUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 2
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 '
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22422

  • eldy
  • eldy's Avatar
  • OFFLINE
  • Administrateur
  • Posts: 1402
  • Thank you received: 8
  • Karma: 150
Support for ' will be available with 3.4
Laurent Destailleur (alias eldy, Dolibarr grade: Yoda).
- Dolibarr in the Cloud: DoliCloud, the OpenSource hosting solution for your Dolibar ERP & CRM.
- Android app for Dolibarr: DoliDroid
- Teclib.com, your Open source solution
The administrator has disabled public write access.

Re: SeparatorThousand=' not allowed? Howto enquote? 1 year 8 months ago #22435

  • DolibarUser
  • DolibarUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 56
  • Karma: 2
Thank you very much for this commit! It works great! :)
The administrator has disabled public write access.
Time to create page: 0.087 seconds