Golang 小数点处理
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 to file
dtapps cb4c11ed29
update
6 months ago
.drone.yml - init 2 years ago
.gitignore - 增加输出float64带小数点(自适应) 2 years ago
LICENSE - update 2 years ago
README.md update 6 months ago
big.go - update 2 years ago
big_new.go update 6 months ago
big_operation.go - update operation 2 years ago
big_output.go - update 2 years ago
calculate.go - update 2 years ago
go.mod update 6 months ago
gorm.go update 6 months ago
math.go - update 2 years ago
version.go update 6 months ago

README.md

Golang Decimal

📦 Golang 小数点处理

godoc goproxy.cn goreportcard.com deps.dev

安装

go get -v -u go.dtapp.net/godecimal@v1.0.11

使用

package main

import (
	"go.dtapp.net/godecimal"
	"log"
	"reflect"
)

func main() {
	log.Println("加:", godecimal.Float64Add(10, 3), reflect.TypeOf(godecimal.Float64Add(10, 3)))
	log.Println("减", godecimal.Float64Sub(10, 3), reflect.TypeOf(godecimal.Float64Sub(10, 3)))
	log.Println("乘:", godecimal.Float64Mul(10, 3), reflect.TypeOf(godecimal.Float64Mul(10, 3)))
	log.Println("除:", godecimal.Float64Quo(10, 3), reflect.TypeOf(godecimal.Float64Quo(10, 3)))
}