【发布时间】:2018-05-10 14:37:51
【问题描述】:
我正在以 react-final-form 显示货币值。我在现场使用格式功能。
const formatMoney = (value) => {
if (!value) return value;
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
minimumFractionDigits: 2,
currency: 'USD'
});
return formatter.format(value);
};
问题是货币是表单中的另一个选项。我没有看到一种干净的方法来访问格式函数中的其余值。
【问题讨论】:
标签: react-final-form final-form