Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Fields](https://developer.android.com/reference/java/time/format/DecimalStyle#lfields) \| [Methods](https://developer.android.com/reference/java/time/format/DecimalStyle#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/time/format/DecimalStyle#inhmethods)

# DecimalStyle


`
public

final

class
DecimalStyle
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.time.format.DecimalStyle |

<br />

*** ** * ** ***

Localized decimal style used in date and time formatting.


A significant part of dealing with dates and times is the localization.
This class acts as a central point for accessing the information.

## Summary

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/java/time/format/DecimalStyle` | `https://developer.android.com/reference/java/time/format/DecimalStyle#STANDARD` The standard set of non-localized decimal style symbols. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Checks if this DecimalStyle is equal to another DecimalStyle. |
| ` static https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/util/Locale>` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#getAvailableLocales()() ` Lists all the locales that are supported. |
| ` char` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#getDecimalSeparator()() ` Gets the character that represents the decimal point. |
| ` char` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#getNegativeSign()() ` Gets the character that represents the negative sign. |
| ` char` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#getPositiveSign()() ` Gets the character that represents the positive sign. |
| ` char` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#getZeroDigit()() ` Gets the character that represents zero. |
| ` int` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#hashCode()() ` A hash code for this DecimalStyle. |
| ` static https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#of(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Obtains the DecimalStyle for the specified locale. |
| ` static https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#ofDefaultLocale()() ` Obtains the DecimalStyle for the default `https://developer.android.com/reference/java/util/Locale.Category#FORMAT` locale. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#toString()() ` Returns a string describing this DecimalStyle. |
| ` https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#withDecimalSeparator(char)(char decimalSeparator) ` Returns a copy of the info with a new character that represents the decimal point. |
| ` https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#withNegativeSign(char)(char negativeSign) ` Returns a copy of the info with a new character that represents the negative sign. |
| ` https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#withPositiveSign(char)(char positiveSign) ` Returns a copy of the info with a new character that represents the positive sign. |
| ` https://developer.android.com/reference/java/time/format/DecimalStyle` | ` https://developer.android.com/reference/java/time/format/DecimalStyle#withZeroDigit(char)(char zeroDigit) ` Returns a copy of the info with a new character that represents zero. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Fields

### STANDARD

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final DecimalStyle STANDARD
```

The standard set of non-localized decimal style symbols.


This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point.

<br />

## Public methods

### equals

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Checks if this DecimalStyle is equal to another DecimalStyle.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the object to check, null returns false <br /> |

| Returns ||
|---|---|
| `boolean` | true if this is equal to the other date <br /> |

### getAvailableLocales

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Set<Locale> getAvailableLocales ()
```

Lists all the locales that are supported.


At a minimum, the returned `Set` must contain a `Locale` instance equal to
`https://developer.android.com/reference/java/util/Locale#ROOT` and a `Locale` instance equal to
`https://developer.android.com/reference/java/util/Locale#US`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/util/Locale>` | a Set of Locales for which localization is supported <br /> |

### getDecimalSeparator

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public char getDecimalSeparator ()
```

Gets the character that represents the decimal point.


The character used to represent a decimal point may vary by culture.
This method specifies the character to use.

<br />

| Returns ||
|---|---|
| `char` | the character for the decimal point <br /> |

### getNegativeSign

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public char getNegativeSign ()
```

Gets the character that represents the negative sign.


The character used to represent a negative number may vary by culture.
This method specifies the character to use.

<br />

| Returns ||
|---|---|
| `char` | the character for the negative sign <br /> |

### getPositiveSign

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public char getPositiveSign ()
```

Gets the character that represents the positive sign.


The character used to represent a positive number may vary by culture.
This method specifies the character to use.

<br />

| Returns ||
|---|---|
| `char` | the character for the positive sign <br /> |

### getZeroDigit

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public char getZeroDigit ()
```

Gets the character that represents zero.


The character used to represent digits may vary by culture.
This method specifies the zero character to use, which implies the characters for one to nine.

<br />

| Returns ||
|---|---|
| `char` | the character for zero <br /> |

### hashCode

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

A hash code for this DecimalStyle.

<br />

| Returns ||
|---|---|
| `int` | a suitable hash code <br /> |

### of

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static DecimalStyle of (Locale locale)
```

Obtains the DecimalStyle for the specified locale.


This method provides access to locale sensitive decimal style symbols.
If the locale contains "nu" (Numbering System)
[Unicode extensions](https://developer.android.com/reference/java/util/Locale.html#def_locale_extension), returned instance will reflect the values specified with
those extensions.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: the locale, not null <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | the decimal style, not null <br /> |

### ofDefaultLocale

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static DecimalStyle ofDefaultLocale ()
```

Obtains the DecimalStyle for the default
`https://developer.android.com/reference/java/util/Locale.Category#FORMAT` locale.


This method provides access to locale sensitive decimal style symbols.


This is equivalent to calling
`https://developer.android.com/reference/java/time/format/DecimalStyle#of(java.util.Locale)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | the decimal style, not null <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/Locale.Category#FORMAT`

### toString

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string describing this DecimalStyle.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string description, not null <br /> |

### withDecimalSeparator

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DecimalStyle withDecimalSeparator (char decimalSeparator)
```

Returns a copy of the info with a new character that represents the decimal point.


The character used to represent a decimal point may vary by culture.
This method specifies the character to use.

<br />

| Parameters ||
|---|---|
| `decimalSeparator` | `char`: the character for the decimal point <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | a copy with a new character that represents the decimal point, not null <br /> |

### withNegativeSign

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DecimalStyle withNegativeSign (char negativeSign)
```

Returns a copy of the info with a new character that represents the negative sign.


The character used to represent a negative number may vary by culture.
This method specifies the character to use.

<br />

| Parameters ||
|---|---|
| `negativeSign` | `char`: the character for the negative sign <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | a copy with a new character that represents the negative sign, not null <br /> |

### withPositiveSign

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DecimalStyle withPositiveSign (char positiveSign)
```

Returns a copy of the info with a new character that represents the positive sign.


The character used to represent a positive number may vary by culture.
This method specifies the character to use.

<br />

| Parameters ||
|---|---|
| `positiveSign` | `char`: the character for the positive sign <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | a copy with a new character that represents the positive sign, not null <br /> |

### withZeroDigit

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DecimalStyle withZeroDigit (char zeroDigit)
```

Returns a copy of the info with a new character that represents zero.


The character used to represent digits may vary by culture.
This method specifies the zero character to use, which implies the characters for one to nine.

<br />

| Parameters ||
|---|---|
| `zeroDigit` | `char`: the character for zero <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/format/DecimalStyle` | a copy with a new character that represents zero, not null <br /> |