mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
fix: 修复某处金额转换丢失精度的bug
This commit is contained in:
@@ -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));
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user