fix: do not show dollar balance if not enabled

This commit is contained in:
JustSong
2023-06-21 15:45:30 +08:00
parent 1b5c628e66
commit 6536a7be62
3 changed files with 14 additions and 5 deletions

View File

@@ -46,4 +46,13 @@ export function renderQuota(quota, digits = 2) {
return '$' + (quota / quotaPerUnit).toFixed(digits);
}
return renderNumber(quota);
}
export function renderQuotaWithPrompt(quota, digits) {
let displayInCurrency = localStorage.getItem('display_in_currency');
displayInCurrency = displayInCurrency === 'true';
if (displayInCurrency) {
return `(等价金额:${renderQuota(quota, digits)}`;
}
return '';
}