fusenapi/utils/format/price.go

14 lines
221 B
Go
Raw Normal View History

2023-06-02 19:24:58 +08:00
package format
import (
"fmt"
"strconv"
)
2023-09-15 14:52:36 +08:00
// 厘转美元
func CentitoDollar(price int64) float64 {
str := fmt.Sprintf("%.3f", float64(price)/float64(1000))
2023-06-02 19:24:58 +08:00
dollar, _ := strconv.ParseFloat(str, 64)
return dollar
}