feat:充值配置-套餐

This commit is contained in:
dzc committed 2025-01-03 19:54:53 +08:00
1 parent 59aee8fa1a
commit 0e96baace1
9 files changed
+610 -1

No files matched your search

+11
View File
@@ -7,4 +7,15 @@ export function displayPrice(price: any, suffix: string = "元") {
if (typeof price === 'undefined') return '0.0' + suffix
const parsedNumber = typeof price === 'string' ? parseFloat(price) : price
return (parsedNumber / 100.0).toFixed(1) + suffix
}
/**
* 把显示价格改为分
* @param price
* @returns
*/
export const storePrice = (num: number | string | undefined) => {
if (typeof num === 'undefined') return 0
const parsedNumber = typeof num === 'string' ? parseFloat(num) : num
return Math.round(parsedNumber * 100)
}