Compartir a través de


UCharacter.GetUnicodeNumericValue(Int32) Method

Definition

<strong>[icu]</strong> Returns the numeric value for a Unicode code point as defined in the Unicode Character Database.

[Android.Runtime.Register("getUnicodeNumericValue", "(I)D", "", ApiSince=24)]
public static double GetUnicodeNumericValue (int ch);
[<Android.Runtime.Register("getUnicodeNumericValue", "(I)D", "", ApiSince=24)>]
static member GetUnicodeNumericValue : int -> double

Parameters

ch
Int32

Code point to get the numeric value for.

Returns

numeric value of ch, or NO_NUMERIC_VALUE if none is defined.

Attributes

Remarks

<strong>[icu]</strong> Returns the numeric value for a Unicode code point as defined in the Unicode Character Database.

A "double" return type is necessary because some numeric values are fractions, negative, or too large for int.

For characters without any numeric values in the Unicode Character Database, this function will return NO_NUMERIC_VALUE. Note: This is different from the Unicode Standard which specifies NaN as the default value.

<em>API Change:</em> In release 2.2 and prior, this API has a return type int and returns -1 when the argument ch does not have a corresponding numeric value. This has been changed to synch with ICU4C

This corresponds to the ICU4C function u_getNumericValue.

Java documentation for android.icu.lang.UCharacter.getUnicodeNumericValue(int).

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