Num -package:base-prelude package:hledger-lib

Parse a string representation of a number for its value and display attributes. Some international number formats are accepted, eg either period or comma may be used for the decimal mark, and the other of these may be used for separating digit groups in the integer part. See http://en.wikipedia.org/wiki/Decimal_separator for more examples. This returns: the parsed numeric value, the precision (number of digits seen following the decimal mark), the decimal mark character used if any, and the digit group style if any.
Find the number of digits of an Int.
the number of postings to this account
Number (set the tindex field) this journal's transactions, counting upward from 1.
Renumber all the account declarations. This is useful to call when finalising or concatenating Journals, to give account declarations a total order across files.
Interpret a raw number as a decimal number. Returns: - the decimal number - the precision (number of digits after the decimal point) - the decimal point character, if any - the digit group style, if any (digit group character and sizes of digit groups)
Parse and interpret the structure of a number without external hints. Numbers are digit strings, possibly separated into digit groups by one of two types of separators. (1) Numbers may optionally have a decimal mark, which may be either a period or comma. (2) Numbers may optionally contain digit group marks, which must all be either a period, a comma, or a space. It is our task to deduce the characters used as decimal mark and digit group mark, based on the allowed syntax. For instance, we make use of the fact that a decimal mark can occur at most once and must be to the right of all digit group marks.
>>> parseTest rawnumberp "1,234,567.89"
Right (WithSeparators ',' ["1","234","567"] (Just ('.',"89")))

>>> parseTest rawnumberp "1,000"
Left (AmbiguousNumber "1" ',' "000")

>>> parseTest rawnumberp "1 000"
Right (WithSeparators ' ' ["1","000"] Nothing)