---
title: Measurement.AttributedStyle.ByteCount
framework: foundation
role: symbol
role_heading: Structure
path: foundation/measurement/attributedstyle/bytecount
---

# Measurement.AttributedStyle.ByteCount

A format style that converts byte counts into attributed strings.

## Declaration

```swift
struct ByteCount
```

## Overview

Overview Use the attributed modifier on a Measurement.FormatStyle.ByteCount instance to create a format style of this type. The attributed strings that this fomat style creates contain attributes from the AttributeScopes.FoundationAttributes.NumberFormatAttributes attribute scope. Use these attributes to determine which runs of the attributed string represent different parts of the formatted value.

## Topics

### Creating an attributed byte count format style

- [init(style:allowedUnits:spellsOutZero:includesActualByteCount:locale:)](foundation/measurement/attributedstyle/bytecount/init(style:allowedunits:spellsoutzero:includesactualbytecount:locale:).md)

### Formatting a byte count

- [format(_:)](foundation/measurement/attributedstyle/bytecount/format(_:).md)

### Accessing style properties

- [allowedUnits](foundation/measurement/attributedstyle/bytecount/allowedunits.md)
- [Measurement.AttributedStyle.ByteCount.Units](foundation/measurement/attributedstyle/bytecount/units.md)
- [spellsOutZero](foundation/measurement/attributedstyle/bytecount/spellsoutzero.md)
- [includesActualByteCount](foundation/measurement/attributedstyle/bytecount/includesactualbytecount.md)
- [style](foundation/measurement/attributedstyle/bytecount/style-swift.property.md)
- [Measurement.AttributedStyle.ByteCount.Style](foundation/measurement/attributedstyle/bytecount/style-swift.typealias.md)
- [locale](foundation/measurement/attributedstyle/bytecount/locale.md)

### Modifying style locale

- [locale(_:)](foundation/measurement/attributedstyle/bytecount/locale(_:).md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [FormatStyle](foundation/formatstyle.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating attributed strings

- [attributed](foundation/measurement/formatstyle/bytecount/attributed.md)
