fix(core): adjust discount display (#4847)

This commit is contained in:
JimmFly 2023-11-06 18:17:24 +08:00 committed by GitHub
parent cfffcad1b8
commit acf0734c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,10 +53,9 @@ const Settings = () => {
if (detail?.type === 'fixed') {
detail.price = (price.amount / 100).toFixed(2);
detail.yearlyPrice = (price.yearlyAmount / 100 / 12).toFixed(2);
detail.discount = (
(1 - price.yearlyAmount / 12 / price.amount) *
100
).toFixed(2);
detail.discount = Math.floor(
(1 - price.yearlyAmount / 12 / price.amount) * 100
).toString();
}
});