---
title: allowedUnits
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/bytecountformatter/allowedunits
---

# allowedUnits

Specify the units that can be used in the output.

## Declaration

```swift
var allowedUnits: ByteCountFormatter.Units { get set }
```

## Discussion

Discussion If the value is NSByteCountFormatterUseDefault, the formatter uses platform-appropriate settings; otherwise will only the specified units are used. ByteCountFormatter.Units values can be combined using the C OR operator to specify complex formatting strings. The NSByteCountFormatterUseDefault or useAll constants can be used with the C AND or the C NOT operators to create custom formats as well. This is the default value if NSByteCountFormatterUseDefault. note: ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display (0.0035 ZB for instance).

## See Also

### Setting Formatting Styles

- [formattingContext](foundation/bytecountformatter/formattingcontext.md)
- [countStyle](foundation/bytecountformatter/countstyle-swift.property.md)
- [allowsNonnumericFormatting](foundation/bytecountformatter/allowsnonnumericformatting.md)
- [includesActualByteCount](foundation/bytecountformatter/includesactualbytecount.md)
- [isAdaptive](foundation/bytecountformatter/isadaptive.md)
- [includesCount](foundation/bytecountformatter/includescount.md)
- [includesUnit](foundation/bytecountformatter/includesunit.md)
- [zeroPadsFractionDigits](foundation/bytecountformatter/zeropadsfractiondigits.md)
