# NumberStyles

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-numberstyles/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct NumberStyles
```

The styles permitted in the text of a number that is parsed.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

## Members

- [`NONE`](#assoc_const-none)
- [`ALLOW_LEADING_WHITE`](#assoc_const-allow_leading_white)
- [`ALLOW_TRAILING_WHITE`](#assoc_const-allow_trailing_white)
- [`ALLOW_LEADING_SIGN`](#assoc_const-allow_leading_sign)
- [`ALLOW_TRAILING_SIGN`](#assoc_const-allow_trailing_sign)
- [`ALLOW_PARENTHESES`](#assoc_const-allow_parentheses)
- [`ALLOW_DECIMAL_POINT`](#assoc_const-allow_decimal_point)
- [`ALLOW_THOUSANDS`](#assoc_const-allow_thousands)
- [`ALLOW_EXPONENT`](#assoc_const-allow_exponent)
- [`ALLOW_CURRENCY_SYMBOL`](#assoc_const-allow_currency_symbol)
- [`ALLOW_HEX_SPECIFIER`](#assoc_const-allow_hex_specifier)
- [`ALLOW_BINARY_SPECIFIER`](#assoc_const-allow_binary_specifier)
- [`INTEGER`](#assoc_const-integer)
- [`HEX_NUMBER`](#assoc_const-hex_number)
- [`BINARY_NUMBER`](#assoc_const-binary_number)
- [`NUMBER`](#assoc_const-number)
- [`FLOAT`](#assoc_const-float)
- [`CURRENCY`](#assoc_const-currency)
- [`ANY`](#assoc_const-any)
- [`empty`](#function-empty)
- [`all`](#function-all)
- [`bits`](#function-bits)
- [`from_bits`](#function-from_bits)
- [`from_bits_truncate`](#function-from_bits_truncate)
- [`from_bits_retain`](#function-from_bits_retain)
- [`from_name`](#function-from_name)
- [`is_empty`](#function-is_empty)
- [`is_all`](#function-is_all)
- [`intersects`](#function-intersects)
- [`contains`](#function-contains)
- [`insert`](#function-insert)
- [`remove`](#function-remove)
- [`toggle`](#function-toggle)
- [`set`](#function-set)
- [`intersection`](#function-intersection)
- [`union`](#function-union)
- [`difference`](#function-difference)
- [`symmetric_difference`](#function-symmetric_difference)
- [`complement`](#function-complement)
- [`iter`](#function-iter)
- [`iter_names`](#function-iter_names)

<a id="assoc_const-none"></a>

### NONE

```rust
const NONE: Self
```

No style elements: decimal digits only.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_leading_white"></a>

### ALLOW_LEADING_WHITE

```rust
const ALLOW_LEADING_WHITE: Self
```

White space may come first.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_trailing_white"></a>

### ALLOW_TRAILING_WHITE

```rust
const ALLOW_TRAILING_WHITE: Self
```

White space may come last.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_leading_sign"></a>

### ALLOW_LEADING_SIGN

```rust
const ALLOW_LEADING_SIGN: Self
```

A sign may come first.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_trailing_sign"></a>

### ALLOW_TRAILING_SIGN

```rust
const ALLOW_TRAILING_SIGN: Self
```

A sign may come last.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_parentheses"></a>

### ALLOW_PARENTHESES

```rust
const ALLOW_PARENTHESES: Self
```

One pair of parentheses may enclose the number, which is then
negative.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_decimal_point"></a>

### ALLOW_DECIMAL_POINT

```rust
const ALLOW_DECIMAL_POINT: Self
```

A decimal point is permitted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_thousands"></a>

### ALLOW_THOUSANDS

```rust
const ALLOW_THOUSANDS: Self
```

Group separators are permitted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_exponent"></a>

### ALLOW_EXPONENT

```rust
const ALLOW_EXPONENT: Self
```

An exponent (`E` or `e`, an optional sign, digits) is permitted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_currency_symbol"></a>

### ALLOW_CURRENCY_SYMBOL

```rust
const ALLOW_CURRENCY_SYMBOL: Self
```

A currency symbol is permitted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_hex_specifier"></a>

### ALLOW_HEX_SPECIFIER

```rust
const ALLOW_HEX_SPECIFIER: Self
```

The text is a hexadecimal number.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-allow_binary_specifier"></a>

### ALLOW_BINARY_SPECIFIER

```rust
const ALLOW_BINARY_SPECIFIER: Self
```

The text is a binary number.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-integer"></a>

### INTEGER

```rust
const INTEGER: Self
```

Leading and trailing white space and a leading sign.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-hex_number"></a>

### HEX_NUMBER

```rust
const HEX_NUMBER: Self
```

Leading and trailing white space and hexadecimal digits.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-binary_number"></a>

### BINARY_NUMBER

```rust
const BINARY_NUMBER: Self
```

Leading and trailing white space and binary digits.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-number"></a>

### NUMBER

```rust
const NUMBER: Self
```

White space, a leading or trailing sign, a decimal point and
group separators.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-float"></a>

### FLOAT

```rust
const FLOAT: Self
```

White space, a leading sign, a decimal point and an exponent.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-currency"></a>

### CURRENCY

```rust
const CURRENCY: Self
```

Every style except the exponent and the hexadecimal and binary
specifiers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="assoc_const-any"></a>

### ANY

```rust
const ANY: Self
```

Every style except the hexadecimal and binary specifiers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-empty"></a>

### empty

```rust
const fn empty() -> Self
```

Get a flags value with all bits unset.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-all"></a>

### all

```rust
const fn all() -> Self
```

Get a flags value with all known bits set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-bits"></a>

### bits

```rust
const fn bits(self: &Self) -> i32
```

Get the underlying bits value.

The returned value is exactly the bits set in this flags value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-from_bits"></a>

### from_bits

```rust
const fn from_bits(bits: i32) -> $crate::__private::core::option::Option<Self>
```

Convert from a bits value.

This method will return `None` if any unknown bits are set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-from_bits_truncate"></a>

### from_bits_truncate

```rust
const fn from_bits_truncate(bits: i32) -> Self
```

Convert from a bits value, unsetting any unknown bits.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-from_bits_retain"></a>

### from_bits_retain

```rust
const fn from_bits_retain(bits: i32) -> Self
```

Convert from a bits value exactly.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-from_name"></a>

### from_name

```rust
fn from_name(name: &str) -> $crate::__private::core::option::Option<Self>
```

Get a flags value with the bits of a flag with the given name set.

This method will return `None` if `name` is empty or doesn't
correspond to any named flag.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-is_empty"></a>

### is_empty

```rust
const fn is_empty(self: &Self) -> bool
```

Whether all bits in `self` are unset.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-is_all"></a>

### is_all

```rust
const fn is_all(self: &Self) -> bool
```

Whether all known bits in this flags value are set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-intersects"></a>

### intersects

```rust
const fn intersects(self: &Self, other: Self) -> bool
```

Whether any set bits in `other` are also set in `self`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-contains"></a>

### contains

```rust
const fn contains(self: &Self, other: Self) -> bool
```

Whether all set bits in `other` are also set in `self`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-insert"></a>

### insert

```rust
fn insert(self: &mut Self, other: Self)
```

The bitwise or (`|`) of the bits in `self` and `other`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-remove"></a>

### remove

```rust
fn remove(self: &mut Self, other: Self)
```

The intersection of `self` with the complement of `other` (`&!`).

This method is not equivalent to `self & !other` when `other` has unknown bits set.
`remove` won't truncate `other`, but the `!` operator will.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-toggle"></a>

### toggle

```rust
fn toggle(self: &mut Self, other: Self)
```

The bitwise exclusive-or (`^`) of the bits in `self` and `other`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-set"></a>

### set

```rust
fn set(self: &mut Self, other: Self, value: bool)
```

Call `insert` when `value` is `true` or `remove` when `value` is `false`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-intersection"></a>

### intersection

```rust
const fn intersection(self: Self, other: Self) -> Self
```

The bitwise and (`&`) of the bits in `self` and `other`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-union"></a>

### union

```rust
const fn union(self: Self, other: Self) -> Self
```

The bitwise or (`|`) of the bits in `self` and `other`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-difference"></a>

### difference

```rust
const fn difference(self: Self, other: Self) -> Self
```

The intersection of `self` with the complement of `other` (`&!`).

This method is not equivalent to `self & !other` when `other` has unknown bits set.
`difference` won't truncate `other`, but the `!` operator will.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-symmetric_difference"></a>

### symmetric_difference

```rust
const fn symmetric_difference(self: Self, other: Self) -> Self
```

The bitwise exclusive-or (`^`) of the bits in `self` and `other`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-complement"></a>

### complement

```rust
const fn complement(self: Self) -> Self
```

The bitwise negation (`!`) of the bits in `self`, truncating the result.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-iter"></a>

### iter

```rust
const fn iter(self: &Self) -> $crate::iter::Iter<NumberStyles>
```

Yield a set of contained flags values.

Each yielded flags value will correspond to a defined named flag. Any unknown bits
will be yielded together as a final flags value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

<a id="function-iter_names"></a>

### iter_names

```rust
const fn iter_names(self: &Self) -> $crate::iter::IterNames<NumberStyles>
```

Yield a set of contained named flags values.

This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/number_styles.rs#L5)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Flags`
- `PublicFlags`
- `Binary`
- `Octal`
- `LowerHex`
- `UpperHex`
- `BitOr`
- `BitOrAssign`
- `BitXor`
- `BitXorAssign`
- `BitAnd`
- `BitAndAssign`
- `Sub`
- `SubAssign`
- `Not`
- `Extend<NumberStyles>`
- `FromIterator<NumberStyles>`
- `IntoIterator`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
