Round displayed remaining balance values
This commit is contained in:
12
web/src/helpers/render.jsx
vendored
12
web/src/helpers/render.jsx
vendored
@@ -1066,8 +1066,14 @@ export function renderQuotaWithAmount(amount) {
|
||||
if (quotaDisplayType === 'TOKENS') {
|
||||
return renderNumber(renderUnitWithQuota(amount));
|
||||
}
|
||||
|
||||
const numericAmount = Number(amount);
|
||||
const formattedAmount = Number.isFinite(numericAmount)
|
||||
? numericAmount.toFixed(2)
|
||||
: amount;
|
||||
|
||||
if (quotaDisplayType === 'CNY') {
|
||||
return '¥' + amount;
|
||||
return '¥' + formattedAmount;
|
||||
} else if (quotaDisplayType === 'CUSTOM') {
|
||||
const statusStr = localStorage.getItem('status');
|
||||
let symbol = '¤';
|
||||
@@ -1077,9 +1083,9 @@ export function renderQuotaWithAmount(amount) {
|
||||
symbol = s?.custom_currency_symbol || symbol;
|
||||
}
|
||||
} catch (e) {}
|
||||
return symbol + amount;
|
||||
return symbol + formattedAmount;
|
||||
}
|
||||
return '$' + amount;
|
||||
return '$' + formattedAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user