QuickInfo icon indicating copy to clipboard operation
QuickInfo copied to clipboard

Fractions oh my!

Open abock opened this issue 5 years ago • 0 comments

I would love to render the unicode equivalent of a fraction. If I enter 1/16 for example, I want to see superscript 1 (¹) over () subscript 16(₁₆) . If I enter a fraction that is available already as a single code point, print that instead (1/8).

For bonus points, reduce the fraction if it can be reduced, and show both the input fraction and the reduced fraction in unicode form.

For even more bonus points, since Quick Info already evaluates expressions, perhaps any result that you are currently showing in decimal notation could also be shown in rational form.

Examples

Input Output Output
1 / 16 ¹⁄₁₆
2/16 ²⁄₁₆
0.125
2 + 1 / 5 2¹⁄₅ ¹¹⁄₅

abock avatar Oct 16 '20 15:10 abock