# ByteSizeHelper

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

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

```rust
struct ByteSizeHelper
```

Formats a size in bytes as text with a decimal unit prefix (`1.5 KB`).

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

## Members

- [`to_string`](#function-to_string)

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

### to_string

```rust
fn to_string(bytes: u64, separate: bool) -> String
```

The text of `bytes` with the largest decimal unit that keeps the
number at least one, with at most one fractional digit, formatted
with the conventions of the current culture.

`separate` puts a space between the number and the unit; as in the
original, only a size of zero honours it.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

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