HUGO
News Docs Themes Community GitHub

lang.FormatCurrency

Returns a currency representation of a number for the given currency and precision for the current language and region.

Syntax

lang.FormatCurrency PRECISION CURRENCY NUMBER

Returns

string
{{ 512.5032 | lang.FormatCurrency 2 "USD" }} → $512.50

Localization of dates, currencies, numbers, and percentages is performed by the gohugoio/locales package. The language tag of the current site must match one of the listed locales.