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

This commit is contained in:
Cameron Moore 2017-09-25 21:01:59 -05:00 committed by Bjørn Erik Pedersen
parent d9697e275e
commit 8a69d23567

View file

@ -36,6 +36,13 @@ func init() {
}, },
) )
ns.AddMethodMapping(ctx.Ceil,
nil,
[][2]string{
{"{{math.Ceil 2.1}}", "3"},
},
)
ns.AddMethodMapping(ctx.Div, ns.AddMethodMapping(ctx.Div,
[]string{"div"}, []string{"div"},
[][2]string{ [][2]string{
@ -43,6 +50,13 @@ func init() {
}, },
) )
ns.AddMethodMapping(ctx.Floor,
nil,
[][2]string{
{"{{math.Floor 1.9}}", "1"},
},
)
ns.AddMethodMapping(ctx.Log, ns.AddMethodMapping(ctx.Log,
nil, nil,
[][2]string{ [][2]string{
@ -71,6 +85,13 @@ func init() {
}, },
) )
ns.AddMethodMapping(ctx.Round,
nil,
[][2]string{
{"{{math.Round 1.5}}", "2"},
},
)
ns.AddMethodMapping(ctx.Sub, ns.AddMethodMapping(ctx.Sub,
[]string{"sub"}, []string{"sub"},
[][2]string{ [][2]string{