-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currency format without fractional values #9141
Comments
Duplicate of #8858. Addressed with #8950. If you think the documentation needs additional clarification, please create an issue or pull request in https://github.com/gohugoio/hugoDocs. Thanks. |
Never mind. Hidden in plain sight! Still unfortunate that we can't resolve the "stylistic printing" issue as explained in #8858. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The function
lang.FormatCurrency
works as expected with 2 or more decimals:{{ 123 | lang.FormatCurrency 4 "EUR" }}
->123,0000 €
Sometimes one might wish to get outputs like
123 €
f.e. for readability concerns.These calls:
{{ 123 | lang.FormatCurrency 0 "EUR" }}
->123,00 €
{{ 123 | lang.FormatCurrency 1 "EUR" }}
->123,00 €
{{ 123 | lang.FormatCurrency 2 "EUR" }}
->123,00 €
all give two digits. Instead I would expect the following:
{{ 123 | lang.FormatCurrency 0 "EUR" }}
->123 €
{{ 123 | lang.FormatCurrency 1 "EUR" }}
->123,0 €
{{ 123 | lang.FormatCurrency 2 "EUR" }}
->123,00 €
If for some reason this is not possible, one should extend the documentation explaining
precision >= 2
.The text was updated successfully, but these errors were encountered: