新增:优惠券、积分明细
This commit is contained in:
@@ -108,6 +108,20 @@ export function truncateText(text: string, maxLength: number = 30): string {
|
||||
return text.substring(0, maxLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化货币
|
||||
* @param amount
|
||||
* @param currency
|
||||
*/
|
||||
export function formatCurrency(amount: number, currency: string = 'CNY'): string {
|
||||
return new Intl.NumberFormat('zh-CN', {
|
||||
style: 'currency',
|
||||
currency: currency,
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
}).format(amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单标题
|
||||
* @param goodsNames 商品名称数组
|
||||
|
||||
Reference in New Issue
Block a user