ai-gateway/common/utils.go

15 lines
290 B
Go
Raw Normal View History

2023-04-22 12:39:27 +00:00
package common
import (
"fmt"
2024-01-28 11:38:58 +00:00
"github.com/songquanpeng/one-api/common/config"
2023-04-22 12:39:27 +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 {
return fmt.Sprintf("%d 点额度", quota)
}
}