Converting String “2½” (two and a half) into 2.5
问题 Right now I'm building a small app that imports data from a spreadsheet and due to the nature of the original entry, there is a string being read in that has values such as 8½, 2½, etc. My goal with a simple function is to convert 2½ into float 2.5, for example. I've tried the .to_f method but that has left me with a weird value of 2.02½. Any insight or suggestions here would be very much appreciated! 回答1: Unicode only supports a small number of vulgar fractions so a simple lookup table will