Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
demo-go
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭芳
demo-go
Commits
6e61fe82
Commit
6e61fe82
authored
Feb 22, 2023
by
彭芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[minor]: format calc data
parent
8531d67b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
go.mod
go.mod
+1
-0
go.sum
go.sum
+2
-0
report.go
internal/biz/report.go
+0
-0
float64.go
internal/util/float64.go
+14
-0
No files found.
go.mod
View file @
6e61fe82
...
...
@@ -18,6 +18,7 @@ require (
github.com/gin-contrib/pprof v1.4.0
github.com/gin-gonic/gin v1.8.2
github.com/google/uuid v1.3.0
github.com/shopspring/decimal v1.3.1
)
require (
...
...
go.sum
View file @
6e61fe82
...
...
@@ -132,6 +132,8 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/shirou/gopsutil/v3 v3.21.8/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
...
...
internal/biz/report.go
View file @
6e61fe82
This diff is collapsed.
Click to expand it.
internal/util/float64.go
0 → 100644
View file @
6e61fe82
package
util
import
(
"fmt"
"github.com/shopspring/decimal"
)
type
Float64
float64
func
(
f
Float64
)
MarshalJSON
()
([]
byte
,
error
)
{
out
,
_
:=
decimal
.
NewFromFloat
(
float64
(
f
))
.
Round
(
2
)
.
Float64
()
return
[]
byte
(
fmt
.
Sprint
(
out
)),
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment