tokenFactory/common/quota.go

15 lines
439 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package common
func GetTrustQuota() int {
return int(10 * QuotaPerUnit)
}
// QuotaFromUSD 将美元金额换算为站内额度整数与充值入账、TopUp.Money * QuotaPerUnit 的策略一致:向零截断)。
// 用于运营后台「注册类邀请奖励」等以美元配置、以 quota 存储的场景。
func QuotaFromUSD(usd float64) int {
if usd <= 0 || QuotaPerUnit <= 0 {
return 0
}
return int(usd * QuotaPerUnit)
}