diff --git a/web/src/helpers/render.js b/web/src/helpers/render.js index 762e740a..adfef86c 100644 --- a/web/src/helpers/render.js +++ b/web/src/helpers/render.js @@ -37,21 +37,17 @@ export function renderNumber(num) { } } -export function renderQuota(quota, digits = 10) { +export function renderQuota(quota, digits = 3) { let quotaPerUnit = localStorage.getItem('quota_per_unit'); let displayInCurrency = localStorage.getItem('display_in_currency'); quotaPerUnit = parseFloat(quotaPerUnit); displayInCurrency = displayInCurrency === 'true'; if (displayInCurrency) { - let displayValue = (quota / quotaPerUnit).toFixed(digits); - // 去除尾部多余的零 - displayValue = parseFloat(displayValue).toString(); - return '$' + displayValue; + return '$' + (quota / quotaPerUnit).toFixed(digits); } return renderNumber(quota); } - export function renderQuotaWithPrompt(quota, digits) { let displayInCurrency = localStorage.getItem('display_in_currency'); displayInCurrency = displayInCurrency === 'true'; diff --git a/web/src/pages/Token/EditToken.js b/web/src/pages/Token/EditToken.js index fa9ac945..ae0331e7 100644 --- a/web/src/pages/Token/EditToken.js +++ b/web/src/pages/Token/EditToken.js @@ -11,7 +11,7 @@ const EditToken = () => { const [loading, setLoading] = useState(isEdit); const originInputs = { name: '', - remain_quota: isEdit ? 0 : renderQuota(500000), + remain_quota: isEdit ? 0 : 100, expired_time: -1, unlimited_quota: false };