6 ms·
Unicode Fractions
- shawkinaw 10y agoSo happy they discussed the use of the word "vulgar" in the symbol names, that was interesting.
- ramshorns 10y agoThere's another way to make fractions in Unicode, using the fraction slash (U+2044) and/or superscript and subscript numerals. That way you can get arbitrary fractions that don't have their own vulgar fraction character.
- extra88 10y agoNice! FYI, that's the hex value so in HTML write it like so: Fraction four sevenths: <sup>4</sup>⁄<sub>7</sub>
- deleted 10y ago[deleted]
- bmh_ca 10y agoI wonder if a single fraction would have better kerning than could be achieved with the slash and super/subscripts.
- extra88 10y agoI'm not a typography nerd and I'm sure the Unicode fractions are typically tighter but it looks okay to me. http://output.jsbin.com/veqakaj http://output.jsbin.com/veqakaj
- ramshorns 10y agoThere are a few ways to do it, including Unicode superscript and subscript characters rather than formatting. These ones all look a bit different in my browser: https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts#Uses https://en.wikipedia.org/wiki/Unicode_subscripts_and_supersc...
- extra88 10y agoThey sure do, I added the Unicode superscript and subscript variant to that bin page, it's much more compact than the HTML element super and subscripts. I wonder what screenreader support is like for the Unicode vulgar fractions, the HTML, and the all-Unicode variants. Apple's VoiceOver correctly reads the Unicode 'fraction slash' and superscript and subscript numbers. Now that I'm thinking about it, using superscript and subscript with fraction slash visually displays a fraction as we expect but is not semantically correct; unmodified ASCII numbers separated by 'fraction slash' would more accurately represent the numerators and denominators.
- 1wd 10y agoHm, works quite well. ⁹⁄₇
- jamesrom 10y agoYep a solid ⁵⁄₇.
- jmduke 10y agoAh, thanks for this! I'm going to add it to the site.
- NuSkooler 10y agoA lot of these (maybe all?) have alt codes in Windows well. Example: Alt+171 = ½
- tincholio 10y agoIf your system supports a "compose" key (X, Mac OS), you can also do them by entering a sequence. For example: "compose 5 8" → ⅝ (the arrow is actually "compose ->")
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- zeristor 10y agoCan these parsed from a string to a double though?
- rurban 10y agoSure. Many languages already have Unicode op support, where the fraction slash binds tighter than the normal division slash. I'll add the generic fraction slash soon, and already have fractions, powers and more.
- techdragon 10y agoIt's little touches like using fractions instead of decimals where appropriate that really improves the usability of software, its something I've made an effort to do over the years, and I certainly think it pays off.