Index: gcalctool/display.c =================================================================== --- gcalctool/display.c (revisiĆ³n: 1950) +++ gcalctool/display.c (copia de trabajo) @@ -50,19 +50,24 @@ { char tnum[MAX_LOCALIZED], *dstp; - if (!v->error && v->show_tsep && v->base == DEC) { + if (!v->error && v->base == DEC) { const char *radixp, *srcp; int n, i; size_t tsep_len; - /* Process the fractional part (if any). */ + /* Process the fractional part (if any), add in radix string. */ srcp = src + strlen(src) - 1; dstp = tnum; if ((radixp = strchr(src, '.')) != NULL) { while (srcp != radixp) { *dstp++ = *srcp--; } - *dstp++ = *srcp--; + size_t radix_len; + radix_len = strlen(v->radix); + for (i = radix_len - 1; i >= 0; i--) { + *dstp++ = v->radix[i]; + } + srcp--; } /* Process the integer part, add in thousand separators. */ @@ -71,7 +76,7 @@ while (srcp >= src) { *dstp++ = *srcp--; n++; - if (n == 3 && srcp >= src && *srcp != '-') { + if (v->show_tsep && n == 3 && srcp >= src && *srcp != '-') { for (i = tsep_len - 1; i >= 0; i--) { *dstp++ = v->tsep[i]; } @@ -90,16 +95,6 @@ } else { STRCPY(dest, src); } - dstp = strchr(dest, '.'); - if (dstp != NULL) { - size_t radix_len; - - radix_len = strlen(v->radix); - if (radix_len != 1) { - memmove(dstp + radix_len, dstp + 1, strlen (dstp + 1) + 1); - } - MEMCPY(dstp, v->radix, radix_len); - } }