|
13 | 13 | * this version handles 64 bit numbers and so can hold values up to |
14 | 14 | * $92,233,720,368,547,758.07. |
15 | 15 | * |
16 | | - * $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.76 2007/11/2415:28:02 momjian Exp $ |
| 16 | + * $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.77 2007/11/2416:18:48 momjian Exp $ |
17 | 17 | */ |
18 | 18 |
|
19 | 19 | #include"postgres.h" |
@@ -337,9 +337,13 @@ cash_out(PG_FUNCTION_ARGS) |
337 | 337 | strncpy((buf+count-strlen(csymbol)+1),csymbol,strlen(csymbol)); |
338 | 338 | count-=strlen(csymbol)-1; |
339 | 339 |
|
340 | | -/* XXX What does this do? It seems to duplicate the last character. */ |
| 340 | +/* |
| 341 | + *If points == 0 and the number of digits % mon_group == 0, |
| 342 | + *the code above adds a trailing ssymbol on the far right, |
| 343 | + *so remove it. |
| 344 | + */ |
341 | 345 | if (buf[LAST_DIGIT]==ssymbol) |
342 | | -buf[LAST_DIGIT]=buf[LAST_PAREN]; |
| 346 | +buf[LAST_DIGIT]='\0'; |
343 | 347 |
|
344 | 348 | /* see if we need to signify negative amount */ |
345 | 349 | if (minus) |
|