Bugfix/%DEC bif with italian decimal separator#798
Merged
lanarimarco merged 4 commits intodevelopfrom Mar 26, 2026
Merged
Conversation
Handle comma as decimal separator in asBigDecimal() so that %DEC correctly parses strings like '1,30' as 1.30. Also normalize line endings to \n in RpgParserFacade to ensure cross-platform consistency. Add BIFDEC01 test to cover both dot and comma decimal separators.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The problem occurred in this case:
This pull request introduces improved support for parsing decimal numbers with both dot and comma as decimal separators, adds a new test case to verify this behavior, and makes a few minor code and test improvements. The most important changes are grouped below:
Decimal parsing improvements:
asBigDecimalutility function inmisc.ktto replace commas with dots before parsing, ensuring that strings with either decimal separator are handled correctly. Now, an error is thrown if parsing fails, improving error visibility.Testing enhancements:
BIFDEC01.rpgle) that checks%DECbehavior with both dot and comma decimal separators, ensuring correct parsing in both cases.executeBIFDEC01) inInterpreterTest.ktto verify the output of the newBIFDEC01program.Minor improvements:
RpgParserFacade.ktby changingjoinToString(System.lineSeparator())tojoinToString("\n")for consistency across platforms.InterpreterTest.ktfor consistency (EVALwithTypeError→evalWithTypeError)..claude/settings.local.jsonfile, likely as cleanup.Related to # (issue)
Checklist:
./gradlew ktlintCheck)../gradlew check).docsdirectory.