The issue was with the localize_number() function. It assumed that the
string to format does not contain ,+*,etc. So it gave incorrect result
when the expression already includes thousand separators. Moreover, the
logic was not working well when there were non-digit characters in the
expression e.g. (,),+,%, etc.

Minor update to the localize_number() function in gcalctool/display.c,
provided in the attached patch. Basically we want to identify 3
contiguous digits, and we need to add the separator only if the next
char is a number. If a non-digit char occurs, I reset the digit counter.

I tested this patch in all calculator modes satisfactorily. Things like
3,333,333,336+36,985 are working now.

I would appreciate if someone reviews this to see if it is acceptable.

** Attachment added: "This is the patch for gcalctool/display.c"
   http://launchpadlibrarian.net/13369125/thousand_separator_fix_raguanu.patch

** Attachment removed: "This is the patch for gcalctool/display.c"

   http://launchpadlibrarian.net/13369122/display.c

-- 
Too many commas in gcalctool
https://bugs.launchpad.net/bugs/208260
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to