修复 【兑换码管理】加款对话框中,预估当前剩余余额为小数,加款金额为小数时,预估充值后剩余剩余前端会计算的精度有误

This commit is contained in:
wangsongsole 2022-06-16 14:59:18 +08:00
parent c8502af423
commit dc6a04b0e9
1 changed files with 8 additions and 6 deletions

View File

@ -58,7 +58,9 @@ export default ({ data, onChangeMoney }) => {
预估当前剩余余额为 预估当前剩余余额为
<span className='green'> <span className='green'>
{' '} {' '}
{stateData?.recharge_amount - stateData?.used_amount}{' '} {(stateData?.recharge_amount - stateData?.used_amount).toFixed(
2
)}{' '}
</span> </span>
</p> </p>
@ -122,11 +124,11 @@ export default ({ data, onChangeMoney }) => {
预估充值后剩余余额为 预估充值后剩余余额为
<span className='blue'> <span className='blue'>
{' '} {' '}
{Math.floor( {(
(stateData?.recharge_amount - stateData?.used_amount) * 100 ((stateData?.recharge_amount - stateData?.used_amount) * 100) /
) /
100 + 100 +
(stateData?.addNew ? stateData.addNew - 0 : 0)}{' '} (stateData?.addNew ? stateData.addNew - 0 : 0)
).toFixed(2)}{' '}
</span> </span>
</p> </p>