maths

package
v1.0.50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Round

func Round(num float64, prec int) float64

Round 四舍五入.

Example
package main

import (
	"fmt"

	"github.com/xuender/oils/maths"
)

func main() {
	fmt.Println(maths.Round(3.005, 2))
	fmt.Println(maths.Round(3.004, 2))
	fmt.Println(maths.Round(3.0006, 3))

}
Output:

3.01
3
3.001

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL