Am trying to parse some HTML in TreeBuilder which returns fractional values '1/2', '1/4', '3/4' and would like to
represent these as decimals.
I hoped I could go into HTML::Entities and find out how to simply spot the mapping of the HTML values to fractions and change it to decimals.
I can see in the source that HTML is converted to the following "frac" values (and vice versa):
frac14 => chr(188),
frac12 => chr(189),
frac34 => chr(190),
But I can't see how the "frac" values are converted to display fractions, or how I can convert these fractions to decimals instead.
Ideally I want frac14, frac12 and frac34 to convert to values to
.25, .5, .75
I suppose I could ignore the modules and go and try to change all the HTML by regexes, but that kind of misses the point and makes everything else harder to maintain.
Thanks for any guidance.