mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
This commit is contained in:
parent
726fe9c3c9
commit
7907d24ba1
16 changed files with 385 additions and 59 deletions
|
@ -1,10 +1,8 @@
|
|||
---
|
||||
title: lang.NumFmt
|
||||
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: ""
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-08-21
|
||||
title: lang
|
||||
package: lang
|
||||
description: "TODO.."
|
||||
date: 2021-07-28
|
||||
categories: [functions]
|
||||
keywords: [numbers]
|
||||
menu:
|
||||
|
@ -12,18 +10,13 @@ menu:
|
|||
parent: "functions"
|
||||
toc: false
|
||||
signature: ["lang.NumFmt PRECISION NUMBER [OPTIONS [DELIMITER]]"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
comments:
|
||||
aliases: ['/functions/numfmt/']
|
||||
type: 'template-func'
|
||||
---
|
||||
|
||||
The default options value is `- . ,`. The default delimiter within the options
|
||||
value is a space. If you need to use a space as one of the options, set a
|
||||
custom delimiter.
|
||||
custom delimiter.s
|
||||
|
||||
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`.
|
||||
|
|
@ -19,6 +19,7 @@ deprecated: false
|
|||
aliases: []
|
||||
---
|
||||
|
||||
|
||||
`time` converts a timestamp string with an optional default location into a [`time.Time`](https://godoc.org/time#Time) structure so you can access its fields:
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue