Merge pull request #3233 from KiGamji/round-remaining-balance
Round remaining balance
This commit is contained in:
commit
efab41c476
@ -537,7 +537,12 @@ export const getChannelsColumns = ({
|
|||||||
</Tag>
|
</Tag>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={t('剩余额度$') + record.balance + t(',点击更新')}
|
content={
|
||||||
|
t('剩余额度') +
|
||||||
|
': ' +
|
||||||
|
renderQuotaWithAmount(record.balance) +
|
||||||
|
t(',点击更新')
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Tag
|
<Tag
|
||||||
color='white'
|
color='white'
|
||||||
|
|||||||
12
web/src/helpers/render.jsx
vendored
12
web/src/helpers/render.jsx
vendored
@ -1068,8 +1068,14 @@ export function renderQuotaWithAmount(amount) {
|
|||||||
if (quotaDisplayType === 'TOKENS') {
|
if (quotaDisplayType === 'TOKENS') {
|
||||||
return renderNumber(renderUnitWithQuota(amount));
|
return renderNumber(renderUnitWithQuota(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const numericAmount = Number(amount);
|
||||||
|
const formattedAmount = Number.isFinite(numericAmount)
|
||||||
|
? numericAmount.toFixed(2)
|
||||||
|
: amount;
|
||||||
|
|
||||||
if (quotaDisplayType === 'CNY') {
|
if (quotaDisplayType === 'CNY') {
|
||||||
return '¥' + amount;
|
return '¥' + formattedAmount;
|
||||||
} else if (quotaDisplayType === 'CUSTOM') {
|
} else if (quotaDisplayType === 'CUSTOM') {
|
||||||
const statusStr = localStorage.getItem('status');
|
const statusStr = localStorage.getItem('status');
|
||||||
let symbol = '¤';
|
let symbol = '¤';
|
||||||
@ -1079,9 +1085,9 @@ export function renderQuotaWithAmount(amount) {
|
|||||||
symbol = s?.custom_currency_symbol || symbol;
|
symbol = s?.custom_currency_symbol || symbol;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
return symbol + amount;
|
return symbol + formattedAmount;
|
||||||
}
|
}
|
||||||
return '$' + amount;
|
return '$' + formattedAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user