]> granicus.if.org Git - postgresql/commitdiff
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 7c6e300f4c255fdff83645874da08b185bd204e7..29f8fc71550a98e0edcef78fe16f0fe975c8c98b 100644 (file)
@@ -1,7 +1,7 @@
 /* -----------------------------------------------------------------------
  * formatting.c
  *
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.134 2007/11/21 22:28:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.135 2007/11/22 15:10:05 momjian Exp $
  *
  *
  *      Portions Copyright (c) 1999-2007, PostgreSQL Global Development Group
@@ -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 eafb8f6628a1b44e99ee8f2698a9c615daa0c8ca..2dee6be79d35e794c46447971712492ae41c5338 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2007, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.92 2007/11/21 22:28:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.93 2007/11/22 15:10:05 momjian Exp $
  *
  * Note: we include postgres.h not postgres_fe.h so that we can include
  * catalog/pg_type.h, and thereby have access to INT4OID and similar macros.
@@ -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