---
title: allowsFractionalUnits
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/datecomponentsformatter/allowsfractionalunits
---

# allowsFractionalUnits

A Boolean indicating whether non-integer units may be used for values.

## Declaration

```swift
var allowsFractionalUnits: Bool { get set }
```

## Discussion

Discussion Fractional units may be used when a value cannot be exactly represented using the available units. For example, if minutes are not allowed, the value “1h 30m” could be formatted as “1.5h”. The default value of this property is false.

## See Also

### Configuring the Formatter Options

- [allowedUnits](foundation/datecomponentsformatter/allowedunits.md)
- [calendar](foundation/datecomponentsformatter/calendar.md)
- [collapsesLargestUnit](foundation/datecomponentsformatter/collapseslargestunit.md)
- [includesApproximationPhrase](foundation/datecomponentsformatter/includesapproximationphrase.md)
- [includesTimeRemainingPhrase](foundation/datecomponentsformatter/includestimeremainingphrase.md)
- [maximumUnitCount](foundation/datecomponentsformatter/maximumunitcount.md)
- [unitsStyle](foundation/datecomponentsformatter/unitsstyle-swift.property.md)
- [zeroFormattingBehavior](foundation/datecomponentsformatter/zeroformattingbehavior-swift.property.md)
