Add comments about thousands separator logic.
authorBruce Momjian <bruce@momjian.us>
Thu, 22 Nov 2007 15:10:05 +0000 (15:10 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 22 Nov 2007 15:10:05 +0000 (15:10 +0000)
src/backend/utils/adt/formatting.c
src/bin/psql/print.c

index 555187277b513eafabc2bbb3e1b748b1ba900978..a3f66ba93c6f73cdce97225f71e85a2d24add14d 100644 (file)
@@ -3925,10 +3925,11 @@ NUM_prepare_locale(NUMProc *Np)
                 * Number thousands separator
                 *
                 * Some locales (e.g. broken glibc pt_BR), have a comma for decimal,
-                * but "" for thousands_sep, so we set the thousands_sep too. 2007-02-12
+                * but "" for thousands_sep, so we set the thousands_sep too.
                 */
                if (lconv->thousands_sep && *lconv->thousands_sep)
                        Np->L_thousands_sep = lconv->thousands_sep;
+               /* Make sure thousands separator doesn't match decimal point symbol. */
                else if (strcmp(Np->decimal, ",") != 0)
                        Np->L_thousands_sep = ",";
                else
index b2cbe74a96416c1f274284b58b449a3ae2c78dd5..997ac56e03cfdc1acac777eb89cdc81d9faa0211 100644 (file)
@@ -2039,6 +2039,7 @@ setDecimalLocale(void)
                grouping = "3";                 /* most common */
        if (*extlconv->thousands_sep)
                thousands_sep = strdup(extlconv->thousands_sep);
+       /* Make sure thousands separator doesn't match decimal point symbol. */
        else if (strcmp(decimal_point, ",") != 0)
                thousands_sep = ",";
        else