我正在使用 globalizejs/globalize ( https://github.com/globalizejs/globalize ) 来格式化我的货币。
我将 maximumFractionDigits 添加为零,但是在运行编译器时,它会翻译它并将原始和模式格式附加到小数点。我想隐藏小数部分,只是在 UI 上显示的整数。
我已经尝试了所有这些但没有运气,请有任何建议。
Globalize.currencyFormatter("THB", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
style: "code",
raw: "#,##"
});
结果是:
currencyFormatterFn(Globalize("en-US").numberFormatter({"minimumFractionDigits":0,"maximumFractionDigits":0,"raw":"#,##0.00"}), Globalize("en-US").pluralGenerator ({}), {"currency":"THB","pattern":"#,##0.00","unitPatterns":{"unitPattern-count-one":"{0} {1}","unitPattern -count-other":"{0} {1}"}})
和这个
Globalize.currencyFormatter("THB", {
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
结果是
Globalize.a1429986586 = numberFormatterFn(["'THB' ",,1,0,0,,,0,3,,"","'THB' #,##0.00","-'THB' 'THB' # ,##0.00","-'THB' ","",numberRound(),"∞","NaN",{".":".",",":",","%": "%","+":"+","-":"-","E":"E","‰":"‰"},]);
Globalize.b2128334345 = currencyFormatterFn(Globalize("en-US").numberFormatter({"minimumFractionDigits":0,"maximumFractionDigits":0,"raw":"'THB' #,##0.00"}));
它总是显示这个 12345.00 泰铢,我希望它显示 12345。