-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
numfmt: add grouping and debug options with locale support #10506
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
base: main
Are you sure you want to change the base?
Conversation
- Add `--grouping` option to use locale-specific separators in output - Add `--debug` option to print warnings during processing - Add `libc` dependency for locale handling - Update help and error messages for new options - Add validation to prevent combining grouping with format - Include translations for new options in en-US and fr-FR locales
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging this PR will degrade performance by 65.65%Comparing Summary
Performance Changes
Footnotes
|
- Conditionally compile locale-related functions for non-Windows platforms - Add Windows-specific stub implementations for `init_locale`, `locale_decimal_separator_char`, and `locale_grouping_separator_string` - Mark test helper functions with `#[cfg(test)]` to avoid unused code warnings - Simplify error handling using `let Some` and `let Ok` patterns - Replace unsafe C string literal with safer `c""` macro
…rging - Extracted `format_field_parse_error` function to centralize error message formatting - Improved `merge_ranges` function with more efficient algorithm using iterator pattern - Fixed logic bug where grouping validation was checking wrong condition - Added early return for empty ranges in merge_ranges for better performance - Simplified error handling in parse_field_list by using the new helper function
|
GNU testsuite comparison: |
|
Once again, please split your pr into several small PR ... |
This commit introduces comprehensive support for handling large numbers and decimal precision in the numfmt utility. Key changes include: - Added num-bigint and num-traits dependencies for arbitrary precision arithmetic - Implemented DecimalValue struct for precise decimal number representation - Added new error messages for value overflow scenarios
|
GNU testsuite comparison: |
…pplied Added checks for `from_unit` and `to_unit` being 1 to ensure `use_raw` is correctly set when no unit conversion or formatting is applied, fixing potential formatting issues in numfmt.
|
GNU testsuite comparison: |
--groupingoption to use locale-specific separators in output--debugoption to print warnings during processinglibcdependency for locale handlingrelated
tests/numfmt/numfmt.pl