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.
* 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>
}
}
- while (isspace(*s) || *s == ')') s++;
+ while (isspace(*s) || *s == '0' || *s == ')') s++;
if (*s != '\0')
elog(WARN,"Bad money external representation %s",str);