# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Enums | Methods | Inherited Methods

# NumberFormatter.UnitWidth

`public static final enum NumberFormatter.UnitWidth`
`` `extends Enum<NumberFormatter.UnitWidth>` ``

java.lang.Object
↳ | java.lang.Enum<android.icu.number.NumberFormatter.UnitWidth>
| ↳ | android.icu.number.NumberFormatter.UnitWidth

An enum declaring how to render units, including currencies. Example outputs when formatting 123 USD and 123 meters in en-CA:

- NARROW: "$123.00" and "123 m"
- SHORT: "US$ 123.00" and "123 m"
- FULL_NAME: "123.00 US dollars" and "123 meters"
- ISO_CODE: "USD 123.00" and undefined behavior
- HIDDEN: "123.00" and "123"

This enum is similar to `MeasureFormat.FormatWidth`.

See also:

- `NumberFormatter`

## Summary

### Enum values
`NumberFormatter.UnitWidth` | `FULL_NAME` Print the full name of the unit, without any abbreviations.
`NumberFormatter.UnitWidth` | `HIDDEN` Format the number according to the specified unit, but do not display the unit.
`NumberFormatter.UnitWidth` | `ISO_CODE` Use the three-digit ISO XXX code in place of the symbol for displaying currencies.
`NumberFormatter.UnitWidth` | `NARROW` Print an abbreviated version of the unit name.
`NumberFormatter.UnitWidth` | `SHORT` Print an abbreviated version of the unit name.

### Public methods
`static NumberFormatter.UnitWidth` | `valueOf(String name)`
`static final UnitWidth[]` | `values()`

### Inherited methods
From class `java.lang.Enum`
`final Object` | `clone()` Throws CloneNotSupportedException.
`final int` | `compareTo(NumberFormatter.UnitWidth o)` Compares this enum with the specified object for order.
`final boolean` | `equals(Object other)` Returns true if the specified object is equal to this enum constant.
`final void` | `finalize()` enum classes cannot have finalize methods.
`final Class<NumberFormatter.UnitWidth>` | `getDeclaringClass()` Returns the Class object corresponding to this enum constant's enum type.
`final int` | `hashCode()` Returns a hash code for this enum constant.
`final String` | `name()` Returns the name of this enum constant, exactly as declared in its enum declaration.
`final int` | `ordinal()` Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
`String` | `toString()` Returns the name of this enum constant, as contained in the declaration.
`static <T extends Enum<T>> T` | `valueOf(Class<T> enumType, String name)` Returns the enum constant of the specified enum type with the specified name.
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.
From interface `java.lang.Comparable`
`abstract int` | `compareTo(NumberFormatter.UnitWidth o)` Compares this object with the specified object for order.

## Enum values

### FULL_NAME

    public static final NumberFormatter.UnitWidth FULL_NAME

Print the full name of the unit, without any abbreviations.

In CLDR, this option corresponds to the default format for measure units and the "¤¤¤" placeholder for currencies.

See also:

- `NumberFormatter`

### HIDDEN

    public static final NumberFormatter.UnitWidth HIDDEN

Format the number according to the specified unit, but do not display the unit. For currencies, apply monetary symbols and formats as with SHORT, but omit the currency symbol. For measure units, the behavior is equivalent to not specifying the unit at all.

See also:

- `NumberFormatter`

### ISO_CODE

    public static final NumberFormatter.UnitWidth ISO_CODE

Use the three-digit ISO XXX code in place of the symbol for displaying currencies. The behavior of this option is currently undefined for use with measure units.

In CLDR, this option corresponds to the "¤¤" placeholder for currencies.

See also:

- `NumberFormatter`

### NARROW

    public static final NumberFormatter.UnitWidth NARROW

Print an abbreviated version of the unit name. Similar to SHORT, but always use the shortest available abbreviation or symbol. This option can be used when the context hints at the identity of the unit. For more information on the difference between NARROW and SHORT, see SHORT.

In CLDR, this option corresponds to the "Narrow" format for measure units and the "¤¤¤¤¤" placeholder for currencies.

See also:

- `NumberFormatter`

### SHORT

    public static final NumberFormatter.UnitWidth SHORT

Print an abbreviated version of the unit name. Similar to NARROW, but use a slightly wider abbreviation or symbol when there may be ambiguity. This is the default behavior.

For example, in es-US, the SHORT form for Fahrenheit is "{0} °F", but the NARROW form is "{0}°", since Fahrenheit is the customary unit for temperature in that locale.

In CLDR, this option corresponds to the "Short" format for measure units and the "¤" placeholder for currencies.

See also:

- `NumberFormatter`

## Public methods

### valueOf

    public static NumberFormatter.UnitWidth valueOf (String name)

Parameters
`name` | `String`

Returns
`NumberFormatter.UnitWidth` |

### values

    public static final UnitWidth[] values ()

Returns
`UnitWidth[]` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*