aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/cash.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1997-04-28 16:15:13 +0000
committerMarc G. Fournier <scrappy@hub.org>1997-04-28 16:15:13 +0000
commitd938b755dc3ee541a935de9b4926477befdb7825 (patch)
tree40bb181025d7ca9e9722967352ea9cf64f52ec18 /src/backend/utils/adt/cash.c
parent36712e8808c48914d25c0f7fcca603a9750b56a3 (diff)
downloadpostgresql-d938b755dc3ee541a935de9b4926477befdb7825.tar.gz
postgresql-d938b755dc3ee541a935de9b4926477befdb7825.zip
From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] Inputting money I notice that I have to put single quotes around money amounts if there is a decimal point in the value. I appears to be happening because there is something changing things like "123.45" to "123.450000" and the code has a problem with that. There may be a better way to fix this but here is a simple change to cash.c that lets it accept trailing zeroes.
Diffstat (limited to 'src/backend/utils/adt/cash.c')
-rw-r--r--src/backend/utils/adt/cash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c
index b6f2d0988c4..93c3e57becb 100644
--- a/src/backend/utils/adt/cash.c
+++ b/src/backend/utils/adt/cash.c
@@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.6 1997/04/24 20:30:41 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.7 1997/04/28 16:15:13 scrappy Exp $
*/
#include <stdio.h>
@@ -125,7 +125,7 @@ cash_in(const char *str)
}
}
- while (isspace(*s) || *s == ')') s++;
+ while (isspace(*s) || *s == '0' || *s == ')') s++;
if (*s != '\0')
elog(WARN,"Bad money external representation %s",str);