Skip to content

Modern Finance CurrencyInvalid

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Finance › Finance › CurrencyInvalid

CurrencyInvalid

Returns the Invalid Currency, which overflow also produces; it never equals anything.

Syntax

CurrencyInvalid( ) as Currency

Notes

  • Overflow lands here rather than raising, in the same style the chrono types use. A failed parse does not: CurrencyParse returns an empty Optional.
  • Absorbing: arithmetic touching it yields Invalid, so one bad value in a long sum does not quietly become a plausible number.
  • IsValid is the only correct test -- an Invalid does not compare equal to anything, itself included.

Examples

#import "std/money"
using money

dim as Currency bad = CurrencyInvalid( )
print bad.IsValid( )         '' false

'' Absorbing: it survives arithmetic rather than being papered over
dim as Currency ten = CurrencyFromInt( 10 )
print ( bad + ten ).IsValid( )                '' false

'' And it never compares equal, so IsValid is the test
print ( bad = CurrencyInvalid( ) )            '' false

Library: Finance
Category: Finance
Documented under: Members

Clone this wiki locally