Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a52d0c

Browse files
committed
Clarify how MONEY trims off trailing thousands separator.
1 parent5f128d5 commit8a52d0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/utils/adt/cash.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* this version handles 64 bit numbers and so can hold values up to
1414
* $92,233,720,368,547,758.07.
1515
*
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 $
1717
*/
1818

1919
#include"postgres.h"
@@ -337,9 +337,13 @@ cash_out(PG_FUNCTION_ARGS)
337337
strncpy((buf+count-strlen(csymbol)+1),csymbol,strlen(csymbol));
338338
count-=strlen(csymbol)-1;
339339

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+
*/
341345
if (buf[LAST_DIGIT]==ssymbol)
342-
buf[LAST_DIGIT]=buf[LAST_PAREN];
346+
buf[LAST_DIGIT]='\0';
343347

344348
/* see if we need to signify negative amount */
345349
if (minus)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp