41 static const char *
const small[] = {
42 "zero",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
43 "eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
44 "fifteen",
"sixteen",
"seventeen",
"eighteen",
"nineteen",
"twenty",
45 "thirty",
"forty",
"fifty",
"sixty",
"seventy",
"eighty",
"ninety"
98 errmsg(
"money out of range")));
111 errmsg(
"money out of range")));
124 errmsg(
"money out of range")));
137 errmsg(
"money out of range")));
150 errmsg(
"money out of range")));
161 errmsg(
"division by zero")));
176 Node *escontext = fcinfo->context;
206 if (*
lconvert->mon_decimal_point !=
'\0' &&
207 lconvert->mon_decimal_point[1] ==
'\0')
211 if (*
lconvert->mon_thousands_sep !=
'\0')
220 printf(
"cashin- precision '%d'; decimal '%c'; thousands '%s'; currency '%s'; positive '%s'; negative '%s'\n",
226 while (
isspace((
unsigned char) *s))
230 while (
isspace((
unsigned char) *s))
234 printf(
"cashin- string is '%s'\n", s);
254 printf(
"cashin- string is '%s'\n", s);
258 while (
isspace((
unsigned char) *s))
262 while (
isspace((
unsigned char) *s))
266 printf(
"cashin- string is '%s'\n", s);
292 errmsg(
"value \"%s\" is out of range for type %s",
311 if (
isdigit((
unsigned char) *s) && *s >=
'5')
317 errmsg(
"value \"%s\" is out of range for type %s",
327 errmsg(
"value \"%s\" is out of range for type %s",
335 while (
isdigit((
unsigned char) *s))
340 if (
isspace((
unsigned char) *s) || *s ==
')')
354 errmsg(
"invalid input syntax for type %s: \"%s\"",
367 errmsg(
"value \"%s\" is out of range for type %s",
420 if (*
lconvert->mon_decimal_point !=
'\0' &&
421 lconvert->mon_decimal_point[1] ==
'\0')
425 if (*
lconvert->mon_thousands_sep !=
'\0')
451 bufptr =
buf +
sizeof(
buf) - 1;
475 *(--bufptr) = (
uvalue % 10) +
'0';
725 errmsg(
"division by zero")));
Datum numeric_div(PG_FUNCTION_ARGS)
Datum numeric_round(PG_FUNCTION_ARGS)
Numeric int64_to_numeric(int64 val)
Datum numeric_int8(PG_FUNCTION_ARGS)
Datum numeric_scale(PG_FUNCTION_ARGS)
Datum numeric_mul(PG_FUNCTION_ARGS)
#define FLOAT8_FITS_IN_INT64(num)
Datum int8_cash(PG_FUNCTION_ARGS)
Datum cash_mul_int8(PG_FUNCTION_ARGS)
Datum flt8_mul_cash(PG_FUNCTION_ARGS)
static Cash cash_mi_cash(Cash c1, Cash c2)
Datum cash_mi(PG_FUNCTION_ARGS)
Datum flt4_mul_cash(PG_FUNCTION_ARGS)
Datum cash_numeric(PG_FUNCTION_ARGS)
static Cash cash_div_int64(Cash c, int64 i)
Datum cash_gt(PG_FUNCTION_ARGS)
Datum cash_div_cash(PG_FUNCTION_ARGS)
Datum cash_mul_flt4(PG_FUNCTION_ARGS)
Datum cash_ne(PG_FUNCTION_ARGS)
Datum cash_out(PG_FUNCTION_ARGS)
static Cash cash_mul_int64(Cash c, int64 i)
static Cash cash_mul_float8(Cash c, float8 f)
Datum cash_ge(PG_FUNCTION_ARGS)
Datum cash_div_int4(PG_FUNCTION_ARGS)
Datum cash_in(PG_FUNCTION_ARGS)
Datum numeric_cash(PG_FUNCTION_ARGS)
Datum cash_pl(PG_FUNCTION_ARGS)
Datum cash_eq(PG_FUNCTION_ARGS)
static Cash cash_div_float8(Cash c, float8 f)
Datum cash_div_int2(PG_FUNCTION_ARGS)
static void append_num_word(StringInfo buf, Cash value)
Datum cash_mul_flt8(PG_FUNCTION_ARGS)
Datum int4_mul_cash(PG_FUNCTION_ARGS)
Datum int2_mul_cash(PG_FUNCTION_ARGS)
Datum cash_div_int8(PG_FUNCTION_ARGS)
Datum cash_lt(PG_FUNCTION_ARGS)
Datum cashlarger(PG_FUNCTION_ARGS)
Datum cash_send(PG_FUNCTION_ARGS)
Datum cash_mul_int4(PG_FUNCTION_ARGS)
static Cash cash_pl_cash(Cash c1, Cash c2)
Datum cash_recv(PG_FUNCTION_ARGS)
Datum cash_div_flt8(PG_FUNCTION_ARGS)
Datum cashsmaller(PG_FUNCTION_ARGS)
Datum cash_le(PG_FUNCTION_ARGS)
Datum cash_div_flt4(PG_FUNCTION_ARGS)
Datum int8_mul_cash(PG_FUNCTION_ARGS)
Datum cash_cmp(PG_FUNCTION_ARGS)
Datum cash_mul_int2(PG_FUNCTION_ARGS)
Datum int4_cash(PG_FUNCTION_ARGS)
Datum cash_words(PG_FUNCTION_ARGS)
#define PG_RETURN_CASH(x)
#define PG_GETARG_CASH(n)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
static float8 float8_mul(const float8 val1, const float8 val2)
static float8 float8_div(const float8 val1, const float8 val2)
#define PG_RETURN_BYTEA_P(x)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_FLOAT8(n)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_CSTRING(n)
#define PG_GETARG_INT64(n)
#define PG_RETURN_TEXT_P(x)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_RETURN_DATUM(x)
#define PG_GETARG_FLOAT4(n)
#define PG_RETURN_BOOL(x)
#define PG_GETARG_INT16(n)
Datum int8mul(PG_FUNCTION_ARGS)
static bool pg_mul_s64_overflow(int64 a, int64 b, int64 *result)
static uint64 pg_abs_s64(int64 a)
static bool pg_sub_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_add_s64_overflow(int64 a, int64 b, int64 *result)
void pfree(void *pointer)
static Datum NumericGetDatum(Numeric X)
struct lconv * PGLC_localeconv(void)
static char buf[DEFAULT_XLOG_SEG_SIZE]
static unsigned char pg_ascii_toupper(unsigned char ch)
static Datum Int64GetDatum(int64 X)
static int64 DatumGetInt64(Datum X)
static Datum Int32GetDatum(int32 X)
char * psprintf(const char *fmt,...)
struct StringInfoData * StringInfo
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void initStringInfo(StringInfo str)
text * cstring_to_text_with_len(const char *s, int len)