---
title: numberFormatter
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/energyformatter/numberformatter
---

# numberFormatter

The number formatter used to format the numbers in energy strings.

## Declaration

```swift
@NSCopying var numberFormatter: NumberFormatter! { get set }
```

## Discussion

Discussion This property defaults to a number formatter using the NumberFormatter.Style.decimal style. You can provide a different number formatter to customize the energy string’s appearance.

## See Also

### Formatting Energy Strings

- [isForFoodEnergyUse](foundation/energyformatter/isforfoodenergyuse.md)
- [getObjectValue(_:for:errorDescription:)](foundation/energyformatter/getobjectvalue(_:for:errordescription:).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)
- [unitStyle](foundation/energyformatter/unitstyle.md)
