Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong price when using comma as decimal #28830

Closed
jjkoa opened this issue Mar 14, 2024 · 6 comments
Closed

Wrong price when using comma as decimal #28830

jjkoa opened this issue Mar 14, 2024 · 6 comments
Labels
Won't be fixed/implemented No tasks will be done for this issue (amount of work may be too high compared to benefits)

Comments

@jjkoa
Copy link

jjkoa commented Mar 14, 2024

Bug

Using Spanish locale (decimal separator is a comma), when adding a product to an order, if the price has 3 decimals, it removes the decimal.

Dolibarr Version

18.0.4

Environment PHP

7.2

Environment Database

MariaDB 11.3.2

Steps to reproduce the behavior and expected behavior

It should just replace the point with a comma in the unit price.

Test with spanish locale, with a 3 decimals product.

Examples:

  • Add a free product, in unit price use: 0.225 -> It changes it to 225.00.
  • Add an existing product, with a unit price of 0.225 -> This example works fine, value is set to 0,225
  • Edit an existing product, with a unit price of 0.225 -> it changes the value to 225.00.

Attached files

No response

@jjkoa jjkoa added the Bug This is a bug (something does not work as expected) label Mar 14, 2024
@ksar-ksar
Copy link
Contributor

Hello,

if Spanish locale, decimal separator is a comma, why do you enter point and not Comma.
If you do the same on Excel for example, it will treat it as String and not number.

@ksar-ksar ksar-ksar added Bug or PR need more information This bug or PR needs more information (answer to a question or more accurate description) and removed Bug This is a bug (something does not work as expected) labels Mar 14, 2024
@jjkoa
Copy link
Author

jjkoa commented Mar 14, 2024

Hi. Excel does treat it as numeric and convert the point to a comma. The numeric keypad has a point, so it would be very annoying to use the numeric keypad and having to type a comma for every decimal.

This was how older versions of dolibarr worked. I have just test it in a dolibarr 5.0.6, and it works fine, it converts the 0.225 to 0,225.

I've seen this issue that is kind of similar: #22535 which seems to fix one of the examples, but It does not work with the other ones.

@ksar-ksar
Copy link
Contributor

And what is your local setting thousands char ?

@jjkoa
Copy link
Author

jjkoa commented Mar 15, 2024

a point: '.' same settings as in the mentioned issue.

@ksar-ksar
Copy link
Contributor

So you understand why if you put a . Dolibarr think that's thousand

@ksar-ksar ksar-ksar added Won't be fixed/implemented No tasks will be done for this issue (amount of work may be too high compared to benefits) and removed Bug or PR need more information This bug or PR needs more information (answer to a question or more accurate description) labels Mar 15, 2024
@jjkoa
Copy link
Author

jjkoa commented Mar 15, 2024

I don't, it does not make any practical sense, no localized software would behave like that, and it was working fine in previous versions. But as you please, I close.

@jjkoa jjkoa closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Won't be fixed/implemented No tasks will be done for this issue (amount of work may be too high compared to benefits)
Projects
None yet
Development

No branches or pull requests

2 participants