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

use space in lang.NumFmt options #5260

Closed
legrostdg opened this Issue Sep 28, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@legrostdg

legrostdg commented Sep 28, 2018

With French typographic rules, prices are supposed to be printed that way:

1 000,23€

But I can't get lang.NumFmt to print a space instead of a dot... I tried lang.NumFmt 2 (.Get 0) "- , " and lang.NumFmt 2 (.Get 0) "- ,  " (nbsp), but both are replaced by no space at all. lang.NumFmt 2 (.Get 0) "- ,  " gave 1 000,23 and lang.NumFmt 2 (.Get 0) "- , \ " nothing at all.

@bep

This comment has been minimized.

Member

bep commented Sep 28, 2018

@moorereason moorereason self-assigned this Sep 28, 2018

@moorereason moorereason added this to the v0.50 milestone Sep 28, 2018

moorereason added a commit to moorereason/hugo that referenced this issue Oct 2, 2018

tpl: Add a delimiter parameter to lang.NumFmt
The original implementation of NumFmt did not take into account that the
options delimiter (a space) could be a valid option.  Adding a delim
parameter seems like the simplest, safest, and most flexible way to
solve this oversight in a backwards-compatible way.

Fixes gohugoio#5260

@bep bep closed this in #5271 Oct 2, 2018

bep added a commit that referenced this issue Oct 2, 2018

tpl: Add a delimiter parameter to lang.NumFmt
The original implementation of NumFmt did not take into account that the
options delimiter (a space) could be a valid option.  Adding a delim
parameter seems like the simplest, safest, and most flexible way to
solve this oversight in a backwards-compatible way.

Fixes #5260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment