ai-gateway/common/utils.go

15 lines
266 B
Go
Raw Normal View History

2023-04-22 12:39:27 +00:00
package common
import (
"fmt"
2024-01-21 15:18:32 +00:00
"one-api/common/config"
2023-04-22 12:39:27 +00:00
)
2024-01-21 15:18:32 +00:00
func LogQuota(quota int) string {
if config.DisplayInCurrencyEnabled {
return fmt.Sprintf("%.6f 额度", float64(quota)/config.QuotaPerUnit)
2023-04-22 12:39:27 +00:00
} else {
2024-01-21 15:18:32 +00:00
return fmt.Sprintf("%d 点额度", quota)
}
}