# format_values

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/converters/composite_format/function-format_values/

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

```rust
fn format_values(format_string: &str, values: &[Option<crate::BoxedValue>]) -> Result<String, FormatError>
```

Replaces the format items of `format` with the text of the matching
untyped values.

Nullable (`Option<T>`) values are unwrapped first. Integers, floating
point numbers, booleans, characters and strings are formatted as the
matching [`FormatArg`](/docs/0.5.0/api/ferroui-base/data/converters/composite_format/enum-formatarg/); every other value is formatted as its display form
(`ValueTypes::to_display_string`) and ignores the format string of the
item. A `Duration` is formatted as the time span
(`FormatArg::TimeSpan`) of the same value.

Numbers, decimals and dates are formatted with the conventions of the
current culture (`string.Format` without a provider); see
[`format_values_with`](/docs/0.5.0/api/ferroui-base/data/converters/composite_format/function-format_values_with/) for another culture.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/converters/composite_format.rs#L289)

## Availability

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