小改动
This commit is contained in:
parent
876e0d429b
commit
bff5456313
@ -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';
|
||||
|
@ -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
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user