mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
util: remove unused func
This commit is contained in:
parent
c07c3c62a9
commit
a66cee9130
|
@ -52,7 +52,7 @@ func (s *State) SlackAttachment() slack.Attachment {
|
|||
Title: s.Asset + " Transfer States",
|
||||
Fields: []slack.AttachmentField{
|
||||
{Title: "Total Number of Transfers", Value: fmt.Sprintf("%d", s.DailyNumberOfTransfers), Short: true},
|
||||
{Title: "Total Amount of Transfers", Value: util.FormatFloat(s.DailyAmountOfTransfers.Float64(), 4), Short: true},
|
||||
{Title: "Total Amount of Transfers", Value: s.DailyAmountOfTransfers.String(), Short: true},
|
||||
},
|
||||
Footer: templateutil.Render("Since {{ . }}", time.Unix(s.Since, 0).Format(time.RFC822)),
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/fixedpoint"
|
||||
)
|
||||
|
||||
const MaxDigits = 18 // MAX_INT64 ~ 9 * 10^18
|
||||
|
||||
var Pow10Table = [MaxDigits + 1]int64{
|
||||
1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18,
|
||||
}
|
||||
|
||||
func Pow10(n int64) int64 {
|
||||
if n < 0 || n > MaxDigits {
|
||||
return 0
|
||||
}
|
||||
return Pow10Table[n]
|
||||
}
|
||||
|
||||
func FormatValue(val fixedpoint.Value, prec int) string {
|
||||
return val.FormatString(prec)
|
||||
}
|
||||
|
||||
func FormatFloat(val float64, prec int) string {
|
||||
return strconv.FormatFloat(val, 'f', prec, 64)
|
||||
}
|
Loading…
Reference in New Issue
Block a user