Share via


NumberFormat.ParseCurrency Method

Definition

Overloads

ParseCurrency(ICharSequence, ParsePosition)

Parses text from the given string as a CurrencyAmount.

ParseCurrency(String, ParsePosition)

Parses text from the given string as a CurrencyAmount.

ParseCurrency(ICharSequence, ParsePosition)

Parses text from the given string as a CurrencyAmount.

[Android.Runtime.Register("parseCurrency", "(Ljava/lang/CharSequence;Ljava/text/ParsePosition;)Landroid/icu/util/CurrencyAmount;", "GetParseCurrency_Ljava_lang_CharSequence_Ljava_text_ParsePosition_Handler", ApiSince=24)]
public virtual Android.Icu.Util.CurrencyAmount? ParseCurrency (Java.Lang.ICharSequence? text, Java.Text.ParsePosition? pos);
[<Android.Runtime.Register("parseCurrency", "(Ljava/lang/CharSequence;Ljava/text/ParsePosition;)Landroid/icu/util/CurrencyAmount;", "GetParseCurrency_Ljava_lang_CharSequence_Ljava_text_ParsePosition_Handler", ApiSince=24)>]
abstract member ParseCurrency : Java.Lang.ICharSequence * Java.Text.ParsePosition -> Android.Icu.Util.CurrencyAmount
override this.ParseCurrency : Java.Lang.ICharSequence * Java.Text.ParsePosition -> Android.Icu.Util.CurrencyAmount

Parameters

text
ICharSequence

the text to parse

pos
ParsePosition

input-output position; on input, the position within text to match; must have 0 &lt;= pos.getIndex() &lt; text.length(); on output, the position after the last matched character. If the parse fails, the position in unchanged upon output.

Returns

a CurrencyAmount, or null upon failure

Attributes

Remarks

Parses text from the given string as a CurrencyAmount. Unlike the parse() method, this method will attempt to parse a generic currency name, searching for a match of this object's locale's currency display names, or for a 3-letter ISO currency code. This method will fail if this format is not a currency format, that is, if it does not contain the currency pattern symbol (U+00A4) in its prefix or suffix.

Java documentation for android.icu.text.NumberFormat.parseCurrency(java.lang.CharSequence, java.text.ParsePosition).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ParseCurrency(String, ParsePosition)

Parses text from the given string as a CurrencyAmount.

public Android.Icu.Util.CurrencyAmount? ParseCurrency (string? text, Java.Text.ParsePosition? pos);
member this.ParseCurrency : string * Java.Text.ParsePosition -> Android.Icu.Util.CurrencyAmount

Parameters

text
String

the text to parse

pos
ParsePosition

input-output position; on input, the position within text to match; must have 0 &lt;= pos.getIndex() &lt; text.length(); on output, the position after the last matched character. If the parse fails, the position in unchanged upon output.

Returns

a CurrencyAmount, or null upon failure

Remarks

Parses text from the given string as a CurrencyAmount. Unlike the parse() method, this method will attempt to parse a generic currency name, searching for a match of this object's locale's currency display names, or for a 3-letter ISO currency code. This method will fail if this format is not a currency format, that is, if it does not contain the currency pattern symbol (U+00A4) in its prefix or suffix.

Java documentation for android.icu.text.NumberFormat.parseCurrency(java.lang.CharSequence, java.text.ParsePosition).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to