14 lines
221 B
Go
14 lines
221 B
Go
|
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
|
||
|
}
|