# wrBytes

> Humanise byte counts using binary (1024-based) units.

Source: https://ngwr.dev/reference/pipes/wr-bytes  
Kind: Pipe

## Import

```angular-ts
import { WrBytes } from 'ngwr/pipes';

@Component({ imports: [WrBytes] })
export class MyComponent { /* ... */ }
```

## Basic usage

```angular-html
{{ 1234 | wrBytes }}  <!-- "1.2 KB" -->
```

## Decimals

Second argument controls the fraction digits.

```angular-html
{{ 1234567 | wrBytes: 0 }}  <!-- "1 MB" -->
{{ 1234567 | wrBytes: 2 }}  <!-- "1.18 MB" -->
```

## Playground

```html
{{ 1234567 | wrBytes: 1 }}
```

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `wrBytes` | Humanise byte counts using binary (1024-based) units. A `null` / `undefined` / empty value renders as an empty string, so a nullable field needs no guard around it. | `(value: number \| string \| null \| undefined, decimals = 1) => string` | `—` |

## See also

- [wr-file-upload](https://ngwr.dev/reference/components/file-upload) — Show human-readable sizes next to picked files.
- [wrNumber](https://ngwr.dev/reference/pipes/wr-number) — General locale-aware number formatting.
