修改额度汇率的展现形式
This commit is contained in:
parent
234fb5ad20
commit
12f6d8d367
@ -15,7 +15,7 @@ var Footer = ""
|
||||
var Logo = ""
|
||||
var TopUpLink = ""
|
||||
var ChatLink = ""
|
||||
var QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens
|
||||
var QuotaPerUnit = 0.002 // $0.002 / 1K tokens
|
||||
var DisplayInCurrencyEnabled = false
|
||||
|
||||
var UsingSQLite = false
|
||||
|
@ -45,7 +45,7 @@ func FatalLog(v ...any) {
|
||||
|
||||
func LogQuota(quota int) string {
|
||||
if DisplayInCurrencyEnabled {
|
||||
return fmt.Sprintf("$%.6f 额度", float64(quota)/QuotaPerUnit)
|
||||
return fmt.Sprintf("$%.6f 额度", float64(quota)/1000*QuotaPerUnit)
|
||||
} else {
|
||||
return fmt.Sprintf("%d 点额度", quota)
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func GetSubscription(c *gin.Context) {
|
||||
}
|
||||
amount := float64(quota)
|
||||
if common.DisplayInCurrencyEnabled {
|
||||
amount /= common.QuotaPerUnit
|
||||
amount = amount / 1000 * common.QuotaPerUnit
|
||||
}
|
||||
subscription := OpenAISubscriptionResponse{
|
||||
Object: "billing_subscription",
|
||||
|
Loading…
Reference in New Issue
Block a user