projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9697e2
)
tpl: Add math.Ceil, Floor, and Round to method mappings
author
Cameron Moore
<moorereason@gmail.com>
Tue, 26 Sep 2017 02:01:59 +0000
(21:01 -0500)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Tue, 26 Sep 2017 06:16:24 +0000
(08:16 +0200)
tpl/math/init.go
patch
|
blob
|
history
diff --git
a/tpl/math/init.go
b/tpl/math/init.go
index 4d740c537c9e24af7d6b206ca8ac133b4ff33353..bbffb23aafd4fcf1fe5d8cff4d0a8c040ff429e8 100644
(file)
--- a/
tpl/math/init.go
+++ b/
tpl/math/init.go
@@
-36,6
+36,13
@@
func init() {
},
)
+ ns.AddMethodMapping(ctx.Ceil,
+ nil,
+ [][2]string{
+ {"{{math.Ceil 2.1}}", "3"},
+ },
+ )
+
ns.AddMethodMapping(ctx.Div,
[]string{"div"},
[][2]string{
@@
-43,6
+50,13
@@
func init() {
},
)
+ 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{