DistributedProofreaders / guiguts

Perl/Tk text editor designed for editing and formatting public domain material for inclusion at Project Gutenberg
GNU General Public License v2.0
9 stars 10 forks source link

Convert negative fractions properly #1299

Closed windymilla closed 4 months ago

windymilla commented 4 months ago

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

Bug noticed during GG2 development.

srjfoo commented 4 months ago

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.