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.
13 lines
188 B
13 lines
188 B
3 years ago
|
package decimal
|
||
3 years ago
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
3 years ago
|
// Decimal 四舍五入
|
||
3 years ago
|
func Decimal(value float64) float64 {
|
||
|
value, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", value), 64)
|
||
|
return value
|
||
|
}
|