---
title: "string(fromByteCount:countStyle:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/bytecountformatter/string(frombytecount:countstyle:)"
---

# string(fromByteCount:countStyle:)

Converts a byte count into the specified string format without creating an NSNumber object.

## Declaration

```swift
class func string(fromByteCount byteCount: Int64, countStyle: ByteCountFormatter.CountStyle) -> String
```

## Parameters

- `byteCount`: The byte count.
- `countStyle`: The formatter style. See doc://com.apple.foundation/documentation/Foundation/ByteCountFormatter/CountStyle-swift.enum for possible values.

## Return Value

Return Value A string containing the formatted byteCount value.

## See Also

### Related Documentation

- [Data Formatting Guide](apple-archive/documentation/Cocoa/Conceptual/DataFormatting.md)

### Creating Strings from Byte Count

- [string(fromByteCount:)](foundation/bytecountformatter/string(frombytecount:).md)
