965 |
static int |
static int |
966 |
try_CCx (char *dst, const struct fmt_spec *fp, double number) |
try_CCx (char *dst, const struct fmt_spec *fp, double number) |
967 |
{ |
{ |
968 |
const struct set_cust_currency *cc = get_cc(fp->type - FMT_CCA); |
const struct custom_currency *cc = get_cc(fp->type - FMT_CCA); |
969 |
|
|
970 |
struct fmt_spec f; |
struct fmt_spec f; |
971 |
|
|
975 |
|
|
976 |
/* Determine length available, decimal character for number |
/* Determine length available, decimal character for number |
977 |
proper. */ |
proper. */ |
978 |
f.type = cc->decimal == get_decimal() ? FMT_COMMA : FMT_DOT; |
f.type = cc->decimal == get_decimal () ? FMT_COMMA : FMT_DOT; |
979 |
f.w = fp->w - strlen (cc->prefix) - strlen (cc->suffix); |
f.w = fp->w - strlen (cc->prefix) - strlen (cc->suffix); |
980 |
if (number < 0) |
if (number < 0) |
981 |
f.w -= strlen (cc->neg_prefix) + strlen (cc->neg_suffix) - 1; |
f.w -= strlen (cc->neg_prefix) + strlen (cc->neg_suffix) - 1; |