mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-15 18:46:41 -04:00
parent
3ac3539f55
commit
976c398f6a
@ -1,14 +1,17 @@
|
|||||||
---
|
---
|
||||||
title: numfmt
|
title: numfmt
|
||||||
linktitle: NumFmt
|
linktitle: 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 `decimal`, `grouping`, and `negative` characters."
|
||||||
godocref:
|
godocref: ""
|
||||||
workson: []
|
workson: []
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
lastmod: 2017-02-01
|
lastmod: 2017-02-01
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
tags: []
|
tags: [numbers]
|
||||||
|
menu:
|
||||||
|
docs:
|
||||||
|
parent: "functions"
|
||||||
toc: false
|
toc: false
|
||||||
ns: "lang"
|
ns: "lang"
|
||||||
signature: ["NumFmt <decimal> <grouping> <negative> <precision> <number>"]
|
signature: ["NumFmt <decimal> <grouping> <negative> <precision> <number>"]
|
||||||
@ -16,13 +19,12 @@ workson: []
|
|||||||
hugoversion:
|
hugoversion:
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
deprecated: false
|
deprecated: false
|
||||||
draft: true
|
draft: false
|
||||||
aliases: []
|
aliases: []
|
||||||
comments:
|
comments:
|
||||||
---
|
---
|
||||||
|
|
||||||
`NumFmt` formats a number with a given precision using the requested `decimal`,
|
`lang.NumFmt` formats a number with a given precision using the requested `decimal`, `grouping`, and `negative` characters. The default options value is `- . ,`.
|
||||||
`grouping`, and `negative` characters.
|
|
||||||
|
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
@ -32,10 +34,3 @@ Numbers greater than or equal to 5 are rounded up. For example, if precision is
|
|||||||
{{ lang.NumFmt "." "," "-" 0 -12345.6789 }} → -12,346
|
{{ lang.NumFmt "." "," "-" 0 -12345.6789 }} → -12,346
|
||||||
{{ -98765.4321 | lang.NumFmt "." "," "-" 2 }} → -98,765.43
|
{{ -98765.4321 | lang.NumFmt "." "," "-" 2 }} → -98,765.43
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit cb28c906b2441a70d017ac2ce35eb6d0ad07f156
|
Subproject commit fcae909507f783b722acd2e20aeeb6fadfc43a7a
|
Loading…
x
Reference in New Issue
Block a user