This commit is contained in:
laodaming
2023-06-02 19:24:58 +08:00
parent 6c717ce30e
commit 92b29d8006
12 changed files with 609 additions and 17 deletions

13
utils/format/price.go Normal file
View File

@@ -0,0 +1,13 @@
package format
import (
"fmt"
"strconv"
)
// 美分转美元
func FentoDollar(price int64) float64 {
str := fmt.Sprintf("%.2f", float64(price)/float64(100))
dollar, _ := strconv.ParseFloat(str, 64)
return dollar
}