📅  最后修改于: 2022-03-11 15:02:28.587000             🧑  作者: Mango
var discount = 0.251;
var option = {
style: 'percent',
minimumFractionDigits: 2,
maximumFractionDigits: 2
};
var formatter = new Intl.NumberFormat("en-US",option);
var discountFormat = formatter.format(discount );
console.log(discountFormat);