--- gcalctool-5.22.1_old/gcalctool/display.c 
+++ gcalctool-5.22.1_new/gcalctool/display.c 
@@ -69,11 +69,20 @@
         tsep_len = strlen(v->tsep);
         n = 0;
         while (srcp >= src) {
+            /* count to 3 digits. We want to identify 3 contiguous digits */
+            if( *srcp >= '0' && *srcp <= '9' )
+                n++;
+            else /* We encountered non-digit. Continuity is broken. Reset our digit counter */
+                n = 0;
+            
             *dstp++ = *srcp--;
-            n++;
+                        
             if (n == 3 && srcp >= src && *srcp != '-') {
-                for (i = tsep_len - 1; i >= 0; i--) {
-                    *dstp++ = v->tsep[i];
+                /* add the separator only if the next source char is a number */
+                if (*srcp >= '0' && *srcp <= '9') {
+                   for (i = tsep_len - 1; i >= 0; i--) {
+                       *dstp++ = v->tsep[i];
+                   }
                 }
                 n = 0;
             }
