corda / net.corda.core.contracts / Amount / parseCurrency

parseCurrency

@JvmStatic fun parseCurrency(input: String): Amount<Currency>

Returns an amount that is equal to the given currency amount in text. Examples of what is supported:

Note this method does NOT respect internationalisation rules: it ignores commas and uses . as the decimal point separator, always. It also ignores the users locale:

Thus an input of $12 expecting some other countries dollar will not work. Do your own parsing if you need correct handling of currency amounts with locale-sensitive handling.

Exceptions

IllegalArgumentException - if the input string was not understood.