Comment 7 for bug 208260

Revision history for this message
Ananth P (ananthp) wrote :

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.