9
9
* workings can be found in the book "Software Solutions in C" by
10
10
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
11
11
*
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 $
13
13
*/
14
14
15
15
#include <stdio.h>
@@ -33,8 +33,7 @@ static const char *num_word(Cash value);
33
33
#define LAST_DIGIT (LAST_PAREN - 1)
34
34
35
35
#ifdef USE_LOCALE
36
- static struct lconv * lconv = NULL ;
37
-
36
+ static struct lconv * lconvert = NULL ;
38
37
#endif
39
38
40
39
/* cash_in()
@@ -65,18 +64,18 @@ cash_in(const char *str)
65
64
csymbol ;
66
65
67
66
#ifdef USE_LOCALE
68
- if (lconv == NULL )
69
- lconv = localeconv ();
67
+ if (lconvert == NULL )
68
+ lconvert = localeconv ();
70
69
71
70
/* frac_digits in the C locale seems to return CHAR_MAX */
72
71
/* 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? */
74
73
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 ;
80
79
#else
81
80
fpoint = 2 ;
82
81
dsymbol = '.' ;
@@ -183,18 +182,18 @@ cash_out(Cash *in_value)
183
182
char convention ;
184
183
185
184
#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 ;
194
193
/* frac_digits in the C locale seems to return CHAR_MAX */
195
194
/* 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 ;
198
197
#else
199
198
mon_group = 3 ;
200
199
comma = ',' ;
0 commit comments