You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/utils/godecimal/godecimal.go

13 lines
190 B

package godecimal
import (
"fmt"
"strconv"
)
// Decimal 四舍五入
func Decimal(value float64) float64 {
value, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", value), 64)
return value
}