ananthakumaran / paisa

Paisa – Personal Finance Manager. https://paisa.fyi demo: https://demo.paisa.fyi
https://paisa.fyi
GNU Affero General Public License v3.0
2.34k stars 117 forks source link

Localization error when displaying Euro values #70

Closed stratosgear closed 10 months ago

stratosgear commented 10 months ago

Describe your Environment Latest docker version

Describe the bug I am testdriving Paisa.

I entered a single sample entry of:

2023/10/01 Salary
    Income:Salary:Acme                      -100,00 Eur
    Assets:Checking                          100,00 Eur

I have configured my settings to use EUR for currency and my locale is set to en-US (yes, I am in Europe but I prefer en-US for my locale.

Unfortunately on the dashboard page I see my total worth as 10,000 which looks totally wrong as it appears I have 10 thousand Euros, while I only have 100.

Expected behavior

I would expect the number to appear as 100.00

I know it is a localization error but I see no way of fixing it from the configuration settings or anywhere else.

Thanks!

ananthakumaran commented 10 months ago

couple of questions

1) in the sample you use 100,00 Eur, this is 100 EUR or 10000 EUR? 2) commodity is case sensitive, make sure you use the correct value everywhere. In the example transaction you are using smaller case.

tribly commented 10 months ago

For 1.: This would be 100 EUR. In this case , is the decimal separator.

ananthakumaran commented 10 months ago

In this case , is the decimal separator.

This is not supported. Decimals can only be separated by .

stratosgear commented 10 months ago

Sorry for the delay here. Yes the amount was 100.00 Euros (one hundred)

I was expecting to see the same number in the dashboard. That is: 100.00. This is the most standard way to display decimal numbers. @tribly is also right in regards to a comma separator (like in 100,00) but this is NOT the correct separator for en-US.

One thing for sure is that 10,000 is really-really wrong. To the point that the whole app (regardless of how pretty or useful it might be) it is unusable.

Thanks again!

ananthakumaran commented 10 months ago

if you use . you would get 100 EUR. Using , as a decimal separator is not supported. , can be used to separate thousands or hundreds or whatever format you want. Paisa does show 100 in the UI in many places instead of 100.00, I will add support for precision soon.

2023/10/01 Salary
    Income:Salary:Acme                      -100.00 EUR
    Assets:Checking                          100.00 EUR
ananthakumaran commented 10 months ago

Looks like ledger already supports European convention, I need to check the details and see if it can be supported by Paisa as well.

ananthakumaran commented 10 months ago

@tribly @stratosgear I have added support for European formatting in the latest release. You have to do a couple of things to get it working. 1) Add a commodity format directive, example below. Set the locale to es-EU. Let me know if it works for you.

commodity EUR
    format 1.000,00 EUR

2022/01/01 Salary
    Income:Salary:Acme                    -11.000,00 EUR
    Assets:Checking                        11.000,00 EUR
tribly commented 10 months ago

Looks good, thanks!

ananthakumaran commented 10 months ago

Thanks for checking.