diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ff84bbf --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 李光春 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 32f50ce..bca3ac7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Golang Decimal -📦 Golang Decimal +📦 Golang 小数点处理 [comment]: <> (go) [![godoc](https://pkg.go.dev/badge/github.com/dtapps/godecimal?status.svg)](https://pkg.go.dev/github.com/dtapps/godecimal) @@ -10,8 +10,27 @@ [![goreportcard.com](https://goreportcard.com/badge/github.com/dtapps/godecimal)](https://goreportcard.com/report/github.com/dtapps/godecimal) [![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/github.com%2Fdtapps%2Fgodecimal) -#### 安装使用 +#### 安装 ```go go get -v -u github.com/dtapps/godecimal +``` + +#### 使用 + +```go +package main + +import ( + "github.com/dtapps/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))) +} ``` \ No newline at end of file