summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorLucas Jenss <lucas@x3ro.de>2017-09-28 00:35:47 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-09-28 16:53:18 +0200
commit57adc539fc98dcb6fba8070b9611b8bd545f6f7f (patch)
tree6460e7c9ef36c7e52212e3ee364f7f0fe2d0138f /docs
parentb277cb33e4dfa7440fca3b7888026944ce056154 (diff)
tpl: Add float template function
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes #3307
Diffstat (limited to 'docs')
-rw-r--r--docs/content/functions/float.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/content/functions/float.md b/docs/content/functions/float.md
new file mode 100644
index 000000000..2a5f7579c
--- /dev/null
+++ b/docs/content/functions/float.md
@@ -0,0 +1,26 @@
+---
+title: float
+linktitle: float
+description: Creates a `float` from the argument passed into the function.
+godocref:
+date: 2017-09-28
+publishdate: 2017-09-28
+lastmod: 2017-09-28
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings,floats]
+signature: ["float INPUT"]
+workson: []
+hugoversion:
+relatedfuncs: []
+deprecated: false
+aliases: []
+---
+
+Useful for turning strings into floating point numbers.
+
+```
+{{ float "1.23" }} → 1.23
+```