diff --git a/src/utils/formatMoney.ts b/src/utils/formatMoney.ts index b9ee379..4615c6d 100644 --- a/src/utils/formatMoney.ts +++ b/src/utils/formatMoney.ts @@ -3,8 +3,8 @@ * @param price * @returns */ -export function displayPrice(price: any, suffix: string = "元", fixed = 1) { - if (typeof price === "undefined") return "0.0" + suffix +export function displayPrice(price: any, suffix: string = "元", fixed = 2) { + if (typeof price === "undefined") return "0.00" + suffix const parsedNumber = typeof price === "string" ? parseFloat(price) : price return (parsedNumber / 100.0).toFixed(fixed) + suffix }