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>`.
2017-02-01
2017-02-01
2017-08-21
functions
numbers
docs
parent
functions
false
lang.NumFmt PRECISION NUMBER [OPTIONS]
false
false
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: ""
workson: []
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-08-21
categories: [functions]
keywords: [numbers]
menu:
docs:
parent: "functions"
toc: false
signature: ["lang.NumFmt PRECISION NUMBER [OPTIONS]"]
workson: []
hugoversion:
relatedfuncs: []
deprecated: false
draft: false
aliases: []
comments:
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.