|
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.13 1997/09/1304:39:08 momjian Exp $ |
| 12 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.14 1997/09/1312:05:32 momjian Exp $ |
13 | 13 | */
|
14 | 14 |
|
15 | 15 | #include<stdio.h>
|
@@ -219,25 +219,25 @@ cash_out(Cash *in_value)
|
219 | 219 | }
|
220 | 220 |
|
221 | 221 | /* we work with positive amounts and add the minus sign at the end */
|
222 |
| -if (*value<0) |
| 222 | +if (value<0) |
223 | 223 | {
|
224 | 224 | minus=1;
|
225 |
| -*value *=-1; |
| 225 | +value *=-1; |
226 | 226 | }
|
227 | 227 |
|
228 | 228 | /* allow for trailing negative strings */
|
229 | 229 | memset(buf,' ',CASH_BUFSZ);
|
230 | 230 | buf[TERMINATOR]=buf[LAST_PAREN]='\0';
|
231 | 231 |
|
232 |
| -while (*value||count> (point_pos-2)) |
| 232 | +while (value||count> (point_pos-2)) |
233 | 233 | {
|
234 | 234 | if (points&&count==point_pos)
|
235 | 235 | buf[count--]=dsymbol;
|
236 | 236 | elseif (comma&&count % (mon_group+1)==comma_position)
|
237 | 237 | buf[count--]=comma;
|
238 | 238 |
|
239 |
| -buf[count--]= (*value %10)+'0'; |
240 |
| -*value /=10; |
| 239 | +buf[count--]= (value %10)+'0'; |
| 240 | +value /=10; |
241 | 241 | }
|
242 | 242 |
|
243 | 243 | buf[count]=csymbol;
|
|