dschopf / plasma-applet-qalculate

Qalculate applet for plasma desktop
MIT License
11 stars 5 forks source link

Recognize both symbols for number decimal separators #22

Closed MurzNN closed 2 years ago

MurzNN commented 5 years ago

Qalculate! full app recognize both symbols as decimal separators (. and ,), example:

1.5*3 = 4,5
1,5*3 = 4,5

but plasma-applet-qalculate accepts only dot (.), and ignore , symbol:

1.5*3 = 4.5
1,5*3 = 45

Can you please fix this problem?

dschopf commented 5 years ago

The behavior you are describing only works if you set "Use comma as decimal separator" and not "Ignore dots in numbers". Otherwise these operations yield different results.

I guess I could provide the same options as well.

MurzNN commented 5 years ago

The behavior you are describing only works if you set "Use comma as decimal separator" and not "Ignore dots in numbers".

Yes, this is default Qalculate! app settings. Thanks for implementing same options!

dschopf commented 3 years ago

This works for me with the latest release of libqalculate without any changes to the applet. Could you check this again?

idamir commented 2 years ago

Confirm, it works.

MurzNN commented 2 years ago

Hmm, for me it still doesn't work with current setup, but now shows the different result: image

And the same on full Qalculate app with default settings: image

And on full app I can turn on the "Use comma as decimal separator" option to fix this, but plasmoid doesn't have such setting.

Maybe such results depend on locale? I have those settings:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=hy_AM
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=hy_AM
LC_NAME=hy_AM
LC_ADDRESS=hy_AM
LC_TELEPHONE=hy_AM
LC_MEASUREMENT=hy_AM
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
idamir commented 2 years ago

Try this plasmoid setting: image

MurzNN commented 2 years ago

Yeah, it works! And even with both variants - 1.5 and 1,5, cool!