ai-gateway/common/utils.go

15 lines
292 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
)
2024-03-13 12:00:51 +00:00
func LogQuota(quota int64) 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)
}
}