After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730905 - gcalccmd doesn't parse input correctly when it is formatted according to LC_NUMERIC
gcalccmd doesn't parse input correctly when it is formatted according to LC_N...
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-28 21:21 UTC by Nils
Modified: 2014-06-08 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle localized radix characters on command line (1.93 KB, patch)
2014-05-29 13:24 UTC, Michael Catanzaro
committed Details | Review

Description Nils 2014-05-28 21:21:29 UTC
It appears that gcalccmd uses the format set in $LC_NUMERIC for its output, but doesn't parse input correctly when it uses a decimal separator other than '.':

$ echo $LC_NUMERIC
de_DE.UTF-8

$ gcalccmd
> 2,2
Error 1
> 2.2
22
> 22/10
2,2
>

nst@beta:~$ LC_NUMERIC=en_US.UTF-8 gcalccmd
> 2,2
22
> 2.2
2.2
> 22/10
2.2
Comment 1 Michael Catanzaro 2014-05-29 13:24:54 UTC
Created attachment 277455 [details] [review]
Handle localized radix characters on command line

We were accounting for the locale's thousands separator, but not the
radix char (decimal point). For example:

export LC_NUMERIC=de_DE.UTF-8
gnome-calculator --solve 2.000,5 - ,2

The result should be 2.000,3 not an error.
Comment 2 PioneerAxon 2014-06-08 19:43:47 UTC
Review of attachment 277455 [details] [review]:

Works well. Committed. :)

Thank you for the patch.
Comment 3 PioneerAxon 2014-06-08 19:44:53 UTC
Thank you for the bug report.

The issue have been fixed in current version, ane will be available with next release of Calculator. :)