Safe Haskell | Safe-Infered |
---|
- data RadGroup
- periodComma :: RadGroup
- periodSpace :: RadGroup
- commaPeriod :: RadGroup
- commaSpace :: RadGroup
- data GroupingSpec
- = NoGrouping
- | GroupLarge
- | GroupAll
- renderUnquoted :: RadGroup -> (GroupingSpec, GroupingSpec) -> Qty -> Text
- quote :: Text -> Text
- qtyUnquoted :: RadGroup -> Parser Qty
- qtyQuoted :: RadGroup -> Parser Qty
- qty :: RadGroup -> Parser Qty
Setting the radix and separator characters
Radix is period, grouping is comma
Radix is period, grouping is space
Radix is comma, grouping is period
Radix is comma, grouping is space
Rendering
data GroupingSpec Source
Specifies how to perform digit grouping when rendering a quantity. All grouping groups into groups of 3 digits.
NoGrouping | Do not perform any digit grouping |
GroupLarge | Group digits, but only if the number to be grouped is greater than 9,999 (if grouping the whole part) or if there are more than 4 decimal places (if grouping the fractional part). |
GroupAll | Group digits whenever there are at least four decimal places. |
:: RadGroup | |
-> (GroupingSpec, GroupingSpec) | Group for the portion to the left and right of the radix point? |
-> Qty | |
-> Text |
Renders an unquoted Qty. Performs digit grouping as requested.
Quotes a rendered Qty, but only if necessary; otherwise, simply leaves it unquoted.
Parsing quantities
qtyUnquoted :: RadGroup -> Parser QtySource
Unquoted quantity. These include no spaces, regardless of what the grouping character is.