Use the new struct lconv members to determine how to format international
monetary values.
This commit is contained in:
parent
40a48101d3
commit
2621915fa7
@ -391,7 +391,18 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space,
|
||||
|
||||
struct lconv *lc = localeconv();
|
||||
|
||||
if (flags & IS_NEGATIVE) {
|
||||
if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) {
|
||||
*cs_precedes = lc->int_n_cs_precedes;
|
||||
*sep_by_space = lc->int_n_sep_by_space;
|
||||
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn;
|
||||
*signstr = (lc->negative_sign == '\0') ? "-"
|
||||
: lc->negative_sign;
|
||||
} else if (flags & USE_INTL_CURRENCY) {
|
||||
*cs_precedes = lc->int_p_cs_precedes;
|
||||
*sep_by_space = lc->int_p_sep_by_space;
|
||||
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn;
|
||||
*signstr = lc->positive_sign;
|
||||
} else if (flags & IS_NEGATIVE) {
|
||||
*cs_precedes = lc->n_cs_precedes;
|
||||
*sep_by_space = lc->n_sep_by_space;
|
||||
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn;
|
||||
|
Loading…
Reference in New Issue
Block a user