Language

RelativeDateTimeFormatter.FormatNumeric Method

Definition

Format a combination of RelativeDateTimeUnit and numeric offset using a numeric style, e.g. "1 week ago", "in 1 week", "5 weeks ago", "in 5 weeks".

[Android.Runtime.Register("formatNumeric", "(DLandroid/icu/text/RelativeDateTimeFormatter$RelativeDateTimeUnit;)Ljava/lang/String;", "", ApiSince=28)]
public string? FormatNumeric(double offset, Android.Icu.Text.RelativeDateTimeFormatter.RelativeDateTimeUnit? unit);
[<Android.Runtime.Register("formatNumeric", "(DLandroid/icu/text/RelativeDateTimeFormatter$RelativeDateTimeUnit;)Ljava/lang/String;", "", ApiSince=28)>]
member this.FormatNumeric : double * Android.Icu.Text.RelativeDateTimeFormatter.RelativeDateTimeUnit -> string

Parameters

offset
Double

The signed offset for the specified unit. This will be formatted according to this object's NumberFormat object.

unit
RelativeDateTimeFormatter.RelativeDateTimeUnit

The unit to use when formatting the relative date, e.g. RelativeDateTimeUnit.WEEK, RelativeDateTimeUnit.FRIDAY.

Returns

The formatted string (may be empty in case of error)

Attributes

Remarks

Format a combination of RelativeDateTimeUnit and numeric offset using a numeric style, e.g. "1 week ago", "in 1 week", "5 weeks ago", "in 5 weeks". This method returns a String. To get more information about the formatting result, use formatNumericToValue().

Android reference for android.icu.text.RelativeDateTimeFormatter.formatNumeric.

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