Merge branch 'main' into dev
This commit is contained in:
commit
2bde4656ed
10 changed files with 380 additions and 80 deletions
|
|
@ -266,12 +266,12 @@ func (r *decoratedGJSONResult) String(key string) string {
|
|||
return r.Get(key).String()
|
||||
}
|
||||
|
||||
func (r *decoratedGJSONResult) Int(key string) int64 {
|
||||
func (r *decoratedGJSONResult) Int(key string) int {
|
||||
if key == "" {
|
||||
return r.Result.Int()
|
||||
return int(r.Result.Int())
|
||||
}
|
||||
|
||||
return r.Get(key).Int()
|
||||
return int(r.Get(key).Int())
|
||||
}
|
||||
|
||||
func (r *decoratedGJSONResult) Float(key string) float64 {
|
||||
|
|
@ -292,11 +292,11 @@ func (r *decoratedGJSONResult) Bool(key string) bool {
|
|||
|
||||
var customAPITemplateFuncs = func() template.FuncMap {
|
||||
funcs := template.FuncMap{
|
||||
"toFloat": func(a int64) float64 {
|
||||
"toFloat": func(a int) float64 {
|
||||
return float64(a)
|
||||
},
|
||||
"toInt": func(a float64) int64 {
|
||||
return int64(a)
|
||||
"toInt": func(a float64) int {
|
||||
return int(a)
|
||||
},
|
||||
"add": func(a, b float64) float64 {
|
||||
return a + b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue