Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
1f126b3817
|
@ -6,8 +6,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// 厘转美元
|
// 厘转美元
|
||||||
func CentitoDollar(price int64) float64 {
|
func CentitoDollar(price int64, remainFloatPoint ...uint) float64 {
|
||||||
str := fmt.Sprintf("%.3f", float64(price)/float64(1000))
|
s := "%.3f"
|
||||||
|
if len(remainFloatPoint) > 0 {
|
||||||
|
s = fmt.Sprintf("%%.%df", remainFloatPoint[0])
|
||||||
|
}
|
||||||
|
fmt.Println(s)
|
||||||
|
str := fmt.Sprintf(s, float64(price)/float64(1000))
|
||||||
dollar, _ := strconv.ParseFloat(str, 64)
|
dollar, _ := strconv.ParseFloat(str, 64)
|
||||||
return dollar
|
return dollar
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user