Skip to content
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

Convert negative fractions properly #1299

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

windymilla
Copy link
Collaborator

Previously converted -1/2 to ½ due to error trying to handle 3-1/2.

Bug noticed during GG2 development.

Previously converted `-1/2` to `½` due to error trying to
handle `3-1/2`.

Bug noticed during GG2 development.
@windymilla windymilla requested a review from srjfoo June 6, 2024 15:57
@windymilla windymilla linked an issue Jun 6, 2024 that may be closed by this pull request
@srjfoo
Copy link
Member

srjfoo commented Jun 6, 2024

Granted, it's kind of a silly thing to do, but, if I try to convert a fraction like -2/23 using "Unicode Only", the numbers and slash are completely thrown away, though the hyphen-minues remains, and I get this error:

18:27:10: Use of uninitialized value $outfraction in concatenation (.) or string at /Users/sharonjoiner/Desktop/guiguts-fractions/src/lib/Guiguts/CharacterTools.pm line 1193.

GG2 does nothing.

I'm wondering if that deserves a user-readable message, something like "Attempt to convert fraction to Unicode failed: no equivalent available" in both places? I'm also okay with just leaving it the way GG2 handles it, and ignoring it, with a warning in the manual.

@windymilla windymilla merged commit 26ee5c3 into DistributedProofreaders:master Jun 8, 2024
1 check passed
@windymilla windymilla deleted the fractions branch June 8, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert fractions converts negative fractions incorrectly.
2 participants