- Float64TwoInt64

This commit is contained in:
gazebo
2019-03-27 17:51:19 +08:00
parent 4fa834f839
commit 11c6386331

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"math"
"net/url"
"reflect"
"strconv"
@@ -276,6 +277,10 @@ func Int2Str(value int) string {
return strconv.Itoa(value)
}
func Float64TwoInt64(data float64) int64 {
return int64(math.Round(data))
}
// timestamp is in second
func Timestamp2Str(timestamp int64) string {
return Time2Str(Timestamp2Time(timestamp))