Permalink
Browse files

tpl: Add math.Ceil, Floor, and Round to method mappings

  • Loading branch information...
moorereason authored and bep committed Sep 26, 2017
1 parent d9697e2 commit 8a69d2356703d9f2fcb75bce0ae514e70ebd8e01
Showing with 21 additions and 0 deletions.
  1. +21 −0 tpl/math/init.go
View
@@ -36,13 +36,27 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Ceil,
nil,
[][2]string{
{"{{math.Ceil 2.1}}", "3"},
},
)
ns.AddMethodMapping(ctx.Div,
[]string{"div"},
[][2]string{
{"{{div 6 3}}", "2"},
},
)
ns.AddMethodMapping(ctx.Floor,
nil,
[][2]string{
{"{{math.Floor 1.9}}", "1"},
},
)
ns.AddMethodMapping(ctx.Log,
nil,
[][2]string{
@@ -71,6 +85,13 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Round,
nil,
[][2]string{
{"{{math.Round 1.5}}", "2"},
},
)
ns.AddMethodMapping(ctx.Sub,
[]string{"sub"},
[][2]string{

0 comments on commit 8a69d23

Please sign in to comment.