summaryrefslogtreecommitdiffstats
path: root/docs/content/functions/NumFmt.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/functions/NumFmt.md')
-rw-r--r--docs/content/functions/NumFmt.md15
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/content/functions/NumFmt.md b/docs/content/functions/NumFmt.md
index 6300c8e91..9940c47b7 100644
--- a/docs/content/functions/NumFmt.md
+++ b/docs/content/functions/NumFmt.md
@@ -1,18 +1,18 @@
---
title: lang.NumFmt
-description: "Formats a number with a given precision using the requested `decimal`, `grouping`, and `negative` characters."
+description: "Formats a number with a given precision using the requested `negative`, `decimal`, and `grouping` options. The `options` parameter is a string consisting of `<negative> <decimal> <grouping>`."
godocref: ""
workson: []
date: 2017-02-01
publishdate: 2017-02-01
-lastmod: 2017-02-01
+lastmod: 2017-08-21
categories: [functions]
#tags: [numbers]
menu:
docs:
parent: "functions"
toc: false
-signature: ["lang.NumFmt <decimal> <grouping> <negative> <precision> <number>"]
+signature: ["lang.NumFmt PRECISION NUMBER [OPTIONS]"]
workson: []
hugoversion:
relatedfuncs: []
@@ -27,8 +27,9 @@ The default options value is `- . ,`.
Numbers greater than or equal to 5 are rounded up. For example, if precision is set to `0`, `1.5` becomes `2`, and `1.4` becomes `1`.
```
-{{ lang.NumFmt "," "." "-" 2 12345.6789 }} → 12.345,68
-{{ lang.NumFmt "." "" "-" 6 -12345.6789 }} → -12345.678900
-{{ lang.NumFmt "." "," "-" 0 -12345.6789 }} → -12,346
-{{ -98765.4321 | lang.NumFmt "." "," "-" 2 }} → -98,765.43
+{{ lang.NumFmt 2 12345.6789 }} → 12,345.68
+{{ lang.NumFmt 2 12345.6789 "- , ." }} → 12.345,68
+{{ lang.NumFmt 0 -12345.6789 "- . ," }} → -12,346
+{{ lang.NumFmt 6 -12345.6789 "- ." }} → -12345.678900
+{{ -98765.4321 | lang.NumFmt 2 }} → -98,765.43
```