SwissQrBill.PaymentAmount (swiss_qr_bill v0.1.2)

Copy Markdown View Source

Payment amount and currency for Swiss QR bills. Amount is optional (nil = blank amount box on payment part).

Summary

Functions

Returns the formatted amount for display (with space as thousands separator). Returns empty string if amount is nil.

Creates payment amount information. Amount can be nil (for bills without a fixed amount).

Returns the QR code data fields. Amount is formatted without thousands separator for the QR code.

Types

t()

@type t() :: %SwissQrBill.PaymentAmount{amount: float() | nil, currency: String.t()}

Functions

formatted_amount(payment_amount)

@spec formatted_amount(t()) :: String.t()

Returns the formatted amount for display (with space as thousands separator). Returns empty string if amount is nil.

new(currency, amount \\ nil)

@spec new(String.t(), float() | nil) :: t()

Creates payment amount information. Amount can be nil (for bills without a fixed amount).

qr_code_data(payment_amount)

@spec qr_code_data(t()) :: [String.t() | nil]

Returns the QR code data fields. Amount is formatted without thousands separator for the QR code.