numbers

package
v0.0.0-...-a626ee0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BankRound

func BankRound(n float64, pos ...int) float64

BankRound 银行家算法, 四舍六入五成双, (奇数进位,偶数舍去)

Banker's algorithm, rounded to double

func MinInt

func MinInt(a, b int) int

func Round

func Round(n float64, pos ...int) float64

Round 通用Round方法, 实现四舍五入

func Round32

func Round32(n float32, pos ...int) float32

Round32 32bits 的四舍五入算法

func RoundAll

func RoundAll(n interface{}, pos ...int) float64

RoundAll 支持任意数字类型保留两位小数, 包括

func ToFixed

func ToFixed(n float64, pos ...int) string

ToFixed 保留两位小数返回字符串类型

Types

This section is empty.

Jump to

Keyboard shortcuts

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