abstract struct Number

Overview

The top-level number type.

Included Modules

Direct Known Subclasses

Defined in:

core_ext/to_money.cr

Instance Method Summary

Instance Method Detail

def to_money(currency = Money.default_currency, exchange = nil) : Money #

Returns a Money instance parsed from self.

See also Money.from_amount.


[View source]
def to_money?(currency = Money.default_currency, exchange = nil) : Money | Nil #

Returns a Money instance parsed from self if possible, nil otherwise.

See also Money.from_amount.


[View source]