boostorg / boostorg/locale

Inconsistent behavior - boost::locale defines `numpunct` for non ICU backends

Open
#64 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
40
Forks
76
PR merge metrics
No merged PRs in 30d

Description

```
#include
#include
int main() {
boost::generator gen;
auto &facet = std::use_facet>(gen("it_IT.UTF-8"));
std::cout << facet.thousand_separator() << ' ' << facet.decimal_point() << '\n';
}
````
This code always outputs ", ." regardless of locale.
Right now the only way to extract std::numpunct information is to format an arbitrary number to a string and extract its, say, second and sixth character, and that's not a very efficient implementation.
I would suggest creating a std::numpunct subclass in icu/numeric.cpp that extracts that information from the `icu::DecimalFormatSymbols` class using `getSymbol`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.