---
title: unitStyle
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/energyformatter/unitstyle
---

# unitStyle

The unit style used by this formatter.

## Declaration

```swift
var unitStyle: Formatter.UnitStyle { get set }
```

## Discussion

Discussion This property defaults to Formatter.UnitStyle.medium. For a complete list of unit styles, see Formatter.UnitStyle.

## See Also

### Formatting Energy Strings

- [isForFoodEnergyUse](foundation/energyformatter/isforfoodenergyuse.md)
- [getObjectValue(_:for:errorDescription:)](foundation/energyformatter/getobjectvalue(_:for:errordescription:).md)
- [numberFormatter](foundation/energyformatter/numberformatter.md)
- [string(fromJoules:)](foundation/energyformatter/string(fromjoules:).md)
- [string(fromValue:unit:)](foundation/energyformatter/string(fromvalue:unit:).md)
- [unitString(fromJoules:usedUnit:)](foundation/energyformatter/unitstring(fromjoules:usedunit:).md)
- [unitString(fromValue:unit:)](foundation/energyformatter/unitstring(fromvalue:unit:).md)
