Module

Data.Finance.Money.Format

Package
purescript-money
Repository
TinkerTravel/purescript-money

#Format Source

type Format = List FormatF

Format specification for amounts.

#FormatF Source

data FormatF

Part of a format specification for amounts.

Constructors

#ifNegative Source

ifNegative :: Format -> Format

Perform a format only if the amount is negative.

#literal Source

literal :: String -> Format

Insert a literal string.

#currencyCode Source

currencyCode :: Format

Insert the currency code.

#absolute Source

absolute :: Format

Insert the absolute value of the amount in decimal.

#sbind Source

sbind :: forall a. Semigroup a => a -> (Unit -> a) -> a

Utility function so you can define formats with do notation. For example:

myFormat = do
  ifNegative $ literal "("
  currencyCode
  literal space
  amount
  ifNegative $ literal ")"
  where discard = sbind

#numeric Source

numeric :: Format

Numeric format, with a minus sign for negative amounts, and no currency indicator.

#numericC Source

numericC :: Format

Numeric format, with a minus sign for negative amounts, and a currency code.

#accountant Source

accountant :: Format

Accountant format, with negative amounts parenthesized, and no currency indicator.

#accountantC Source

accountantC :: Format

Accountant format, with negative amounts parenthesized, and a currency code.