99 * workings can be found in the book "Software Solutions in C" by
1010 * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
1111 *
12- * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.16 1997/09/20 16:15:34 thomas Exp $
12+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.17 1997/10/03 13:10:06 thomas Exp $
1313 */
1414
1515#include <stdio.h>
@@ -33,8 +33,7 @@ static const char *num_word(Cash value);
3333#define LAST_DIGIT (LAST_PAREN - 1)
3434
3535#ifdef USE_LOCALE
36- static struct lconv * lconv = NULL ;
37-
36+ static struct lconv * lconvert = NULL ;
3837#endif
3938
4039/* cash_in()
@@ -65,18 +64,18 @@ cash_in(const char *str)
6564csymbol ;
6665
6766#ifdef USE_LOCALE
68- if (lconv == NULL )
69- lconv = localeconv ();
67+ if (lconvert == NULL )
68+ lconvert = localeconv ();
7069
7170/* frac_digits in the C locale seems to return CHAR_MAX */
7271/* best guess is 2 in this case I think */
73- fpoint = ((lconv -> frac_digits != CHAR_MAX ) ?lconv -> frac_digits :2 );/* int_frac_digits? */
72+ fpoint = ((lconvert -> frac_digits != CHAR_MAX ) ?lconvert -> frac_digits :2 );/* int_frac_digits? */
7473
75- dsymbol = * lconv -> mon_decimal_point ;
76- ssymbol = * lconv -> mon_thousands_sep ;
77- csymbol = * lconv -> currency_symbol ;
78- psymbol = * lconv -> positive_sign ;
79- nsymbol = * lconv -> negative_sign ;
74+ dsymbol = * lconvert -> mon_decimal_point ;
75+ ssymbol = * lconvert -> mon_thousands_sep ;
76+ csymbol = * lconvert -> currency_symbol ;
77+ psymbol = * lconvert -> positive_sign ;
78+ nsymbol = * lconvert -> negative_sign ;
8079#else
8180fpoint = 2 ;
8281dsymbol = '.' ;
@@ -183,18 +182,18 @@ cash_out(Cash *in_value)
183182char convention ;
184183
185184#ifdef USE_LOCALE
186- if (lconv == NULL )
187- lconv = localeconv ();
188-
189- mon_group = * lconv -> mon_grouping ;
190- comma = * lconv -> mon_thousands_sep ;
191- csymbol = * lconv -> currency_symbol ;
192- dsymbol = * lconv -> mon_decimal_point ;
193- nsymbol = lconv -> negative_sign ;
185+ if (lconvert == NULL )
186+ lconvert = localeconv ();
187+
188+ mon_group = * lconvert -> mon_grouping ;
189+ comma = * lconvert -> mon_thousands_sep ;
190+ csymbol = * lconvert -> currency_symbol ;
191+ dsymbol = * lconvert -> mon_decimal_point ;
192+ nsymbol = lconvert -> negative_sign ;
194193/* frac_digits in the C locale seems to return CHAR_MAX */
195194/* best guess is 2 in this case I think */
196- points = ((lconv -> frac_digits != CHAR_MAX ) ?lconv -> frac_digits :2 );/* int_frac_digits? */
197- convention = lconv -> n_sign_posn ;
195+ points = ((lconvert -> frac_digits != CHAR_MAX ) ?lconvert -> frac_digits :2 );/* int_frac_digits? */
196+ convention = lconvert -> n_sign_posn ;
198197#else
199198mon_group = 3 ;
200199comma = ',' ;