# INumberBoxNumberFormatter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/trait-inumberboxnumberformatter/

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

```rust
trait INumberBoxNumberFormatter
```

Formats the value of a [`NumberBox`](/docs/0.5.0/api/ferroui-controls/struct-numberbox/) and parses its text (WinUI's `NumberFormatter`, an
`INumberFormatter2` that is also an `INumberParser`).

Deviation (docs/porting/winui-controls.md, Input): WinUI's default formatter is the regional
`DecimalFormatter` of the user; the port's default is
[`InvariantNumberBoxNumberFormatter`](/docs/0.5.0/api/ferroui-controls/struct-invariantnumberboxnumberformatter/), and an application supplies a regional one.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/number_box.rs#L69)

## Members

- [`format_double`](#function-format_double)
- [`parse_double`](#function-parse_double)

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

### format_double

```rust
fn format_double(self: &Self, value: f64) -> String
```

The text of `value` (`INumberFormatter2::FormatDouble`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/number_box.rs#L71)

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

### parse_double

```rust
fn parse_double(self: &Self, text: &str) -> Option<f64>
```

The number `text` is, or `None` (`INumberParser::ParseDouble`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/number_box.rs#L73)

## Trait implementations

- [`INumberBoxNumberFormatter`](/docs/0.5.0/api/ferroui-controls/trait-inumberboxnumberformatter/)

## Availability

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