#135 Numbers with commas entered wrong in US locale


When a number containing a comma is entered, it appears to Qalculate as a vector. For example, when I enter 1,000,000.00 Qalculate sees the vector [1,0,0]. It appears from the documentation that in the US locale, this entry should be recognized as the number 1000000.00 . My locale is:

$ locale

There isn't any configuration option affecting this.

System is Fedora-17, fully up to date running on an x86_64 system.
Release 3.5.10-38.fc17
Compiler g++


  • Cousteau

    Cousteau - 2013-01-11

    This may be a documentation bug rather than a program bug. Where in the documentation does it say that?

    I've checked and on locales using comma as decimal separator, you can use both "." or "," for decimal separator, but there's an option to "ignore dots in numbers". This option is not in LANG=C, though.

    If you want to use a thousand separator (which is useful for checking that you aren't making any typos), you could use space instead, which is also the recommended way to avoid ambiguity (see http://en.wikipedia.org/wiki/Decimal_mark#Digit_grouping ) and is ignored by Qalculate!.

  • Cousteau

    Cousteau - 2013-02-08

    Maybe there should be 2 options always showing up:
    (1) Decimal separator: [system default (period|comma) ; period ; comma]
    (2) [X] Ignore {comma|period} in numbers; use as thousands separator.
    This would be nice since, despite my locale, I'm used to period being the decimal separator and comma the list separator.

  • Jonathan Ryshpan

    Thanks for your comments about my posting on Qalculate. I don't know where in the documentation I found that for certain locales commas in numbers would be ignored. An earlier version of the manual (http://qalculate.sourceforge.net/gtk-manual/index.html for v0.9.2) expressly forbids separators in numerical input. ("Separators (ex. “1,000.00”), usually comma or dot whichever is not the decimal point, are not allowed.")

    I use qalculate (qalculate-kde) mainly for simple calculations on info from my bank's web site, which appear in the usual U.S. format as something like $123,445.78 (if only it were so large). Qalculate interprets this as the vector [$123, 456.78] but what I want is $123,456.78 . So I'm involved in a lot of tedious editing out of commas.

    How difficult would it be to fix this? The main problem appears to be that it's tied up with the way to enter vectors; it wouldn't be a good idea to fix entry of formatted numbers, while breaking entry of vectors. Would it be a good idea to have a mode in which commas in numbers would be ignored and something else (say semicolons “;”) would separate vector elements?

    I've taken a brief glance at the source for libqalculate (as distributed in Fedora-17), and this part looks pretty straightforward, except that I can't figure out what COMMA_S is; it appears to be unused. A historical artifact?

  • Hanna K.

    Hanna K. - 2016-04-29
    • Status: open --> closed-fixed
  • Hanna K.

    Hanna K. - 2016-04-29

    Added option to ignore commas in numbers (if . is default decimal separator). This option also removes the possibility to use comma as argument separator.


Log in to post a comment.