---
title: "voltUnit(with:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkunit/voltunit(with:)"
---

# voltUnit(with:)

Returns a HealthKit unit for measuring the electrical potential difference in volts with the provided prefix.

## Declaration

```swift
class func voltUnit(with prefix: HKMetricPrefix) -> Self
```

## Parameters

- `prefix`: A valid metric prefix value. For the complete list of prefix values, see doc://com.apple.healthkit/documentation/HealthKit/HKMetricPrefix.

## See Also

### Electrical potential difference

- [volt()](healthkit/hkunit/volt().md)
