6 Commits

Author SHA1 Message Date
Alexander Grund
86e59b6c03 Reduce verbosity of formatting_common test 2025-01-15 13:57:44 +01:00
Alexander Grund
211734c2c8 Add test for formatting large (u)int64 numbers
As reported in #235 formatting the first number which doesn't fit into
int64_t anymore fails to add the thousands separators.
I.e.:
`9223372036854775807` -> `9,223,372,036,854,775,807`
`9223372036854775808` -> `9223372036854775808`

Add a test reproducing that that for all backends.
2025-01-15 13:57:44 +01:00
Alexander Grund
e8f9544352 Replace some TEST_REQUIRE by if TEST 2025-01-10 13:33:08 +01:00
Alexander Grund
d52908bb3c Refactor test_formatting
- Make spelling of "ICU" consistently uppercase (except at start of names)
- Move definitions related to existance of ICU together and sort by name
2024-12-27 12:13:10 +01:00
Alexander Grund
e3b9e2eea6
Workaround missing thousand sep in some POSIX backends
The Drone CI fails because the en_US.UTF-8 `locale_t` does not have a
grouping and thousand separator so "12,345" fails to parse.
Format instead to have the expected format as input.
2024-11-12 16:16:07 +01:00
Alexander Grund
9a346dd5f8
Fix parsing of numbers in floating point format to integers
When parsing a string like "123.456" to an integer the ICU backend would
first parse it greedily to a floating point value and then cast/truncate
it to an integer.
Set the flag to only parse integers when parsing to an integral number.
Care must be taken not to set that when parsing e.g. a currency or date
to an integer where the truncation is intended.
2024-11-11 15:48:24 +01:00