| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Char.Number.VulgarFraction
Description
Uncode has two blocks where vulgar fractions are defined: C1 controls and latin supplement 1 and Number forms. These are fractions that are commenly used.
The module exports function toVulgar and ratioToVulgar to convert the ratio to a Char with that fraction if that exists. The
functon ratioToVulgarFallback and ratioToVulgarFallback are used to try to find a vulgar fraction character, and if that fails,
it prints the fraction with the help of the Small module.
Render to a vulgar fraction
Arguments
| :: (Integral i, Integral j) | |
| => i | The given numerator. |
| -> j | The given denominator. |
| -> Maybe Char | The corresponding |
Convert the given numerator den denominator to a vulgar fraction character, if such character exists; Nothing otherwise.
Render to a vulgar fraction, with a fallback to using small characters
ratioToVulgarFallback Source #
Arguments
| :: Integral i | |
| => Ratio i | The given |
| -> Text | A |
Convert the given Ratio to a singleton Text with the vulgar fraction character,
if such character exists; it will make ue of the ratioPartsToUnicode' to generate a Text
object (with multiple Characters) that looks like a fraction.
Arguments
| :: (Integral i, Integral j) | |
| => i | The given numerator. |
| -> j | The given denominator. |
| -> Text | A |
Convert the given numerator and denominator to a singleton Text with the vulgar fraction character,
if such character exists; it will make ue of the ratioPartsToUnicode' to generate a Text
object (with multiple Characters) that looks like a fraction.