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

# string(from:countStyle:)

Formats the value of the given measurement using the given countStyle.

## Declaration

```swift
class func string(from measurement: Measurement<UnitInformationStorage>, countStyle: ByteCountFormatter.CountStyle) -> String
```

## Discussion

Discussion Throws an exception if the given measurement’s unit does not belong to the NSUnitInformationStorage dimension.
