fix: 修复某处金额转换丢失精度的bug

This commit is contained in:
xiaojunnuo
2024-12-26 01:01:28 +08:00
parent b31c0b6a8d
commit d2d6f12218
5 changed files with 32 additions and 5 deletions
@@ -0,0 +1,9 @@
export const amountUtils = {
toCent(amount: number): number {
return parseInt((amount * 100).toFixed(0));
},
toYuan(amount: number): number {
return parseFloat((amount / 100).toFixed(2));
},
};