diff options
author | Bruce Momjian <bruce@momjian.us> | 2007-11-21 22:28:18 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2007-11-21 22:28:18 +0000 |
commit | 3894e7cc55c059d83433aa33e6c286090d658206 (patch) | |
tree | 98879911d30527969ac982329ef5c087d666ea43 /src/backend/utils/adt/formatting.c | |
parent | 6f3149e4644f27f25e14717225b607eabfbff2e1 (diff) | |
download | postgresql-3894e7cc55c059d83433aa33e6c286090d658206.tar.gz postgresql-3894e7cc55c059d83433aa33e6c286090d658206.zip |
When setting default thousands separator when locale has "", use logic
so new thousands separator doesn't match decimal symbol.
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 9b738d5f1e6..7c6e300f4c2 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.133 2007/11/21 21:49:22 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.134 2007/11/21 22:28:18 momjian Exp $ * * * Portions Copyright (c) 1999-2007, PostgreSQL Global Development Group @@ -3915,7 +3915,6 @@ NUM_prepare_locale(NUMProc *Np) */ if (lconv->decimal_point && *lconv->decimal_point) Np->decimal = lconv->decimal_point; - else Np->decimal = "."; @@ -3926,13 +3925,14 @@ 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 make the thousands_sep comma - * too. 2007-02-12 + * but "" for thousands_sep, so we set the thousands_sep too. 2007-02-12 */ if (lconv->thousands_sep && *lconv->thousands_sep) Np->L_thousands_sep = lconv->thousands_sep; - else + else if (strcmp(Np->decimal, ",") != 0) Np->L_thousands_sep = ","; + else + Np->L_thousands_sep = "."; /* * Currency symbol |