<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMCharacteristicMetadata/format",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMCharacteristicMetadata(py)format"
  },
  "title" : "format"
}
-->

# format

The format of the values for the characteristic.

```
var format: String? { get }
```

## Discussion

The [`format`](/documentation/HomeKit/HMCharacteristicMetadata/format) property tells you what kind of data the characteristic’s [`value`](/documentation/HomeKit/HMCharacteristic/value) contains. For example, you can extend the [`HMCharacteristic`](/documentation/HomeKit/HMCharacteristic) class with a computed property that reports whether a given characteristic is a floating point number:

```swift
extension HMCharacteristic {
    var isFloat: Bool {
        return metadata?.format == HMCharacteristicMetadataFormatFloat
    }
}
```

See [Characteristic Data Formats](/documentation/HomeKit/characteristic-data-formats) for the list of possible formats.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)