<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/OSLogInt32ExtendedFormat/byteCount",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os24OSLogInt32ExtendedFormatO9byteCountyA2CmF"
  },
  "title" : "OSLogInt32ExtendedFormat.byteCount"
}
-->

# OSLogInt32ExtendedFormat.byteCount

A format that displays a 32-bit integer as bytes.

```
case byteCount
```

## Discussion

Use this option to format the interpolated value as bytes, such as `100 kB`. The following example applies the `byteCount` formatter to the 32-bit integer value `100_000`:

```swift
// Create a logger with the specified subsystem and category.
let logger = Logger(subsystem: "com.example.OSLogValueFormatting",
                    category: "Formatter Output")
                
// Assign the value to interpolate.
let value: Int32 = 100_000
                
// Write the value to the log using the specified format.
logger.info(".byteCount output is \(value, format: .byteCount)")
```

And the system writes the folllowing message to the log:

```
[Formatter Output] .byteCount output is 100 kB
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)