             return HKUnit.gramUnitWithMetricPrefix(HKMetricPrefix.Milli)
 
         case HKQuantityTypeIdentifierDistanceWalkingRunning:
-            return isMetric ? HKUnit.meterUnitWithMetricPrefix(HKMetricPrefix.Kilo) : HKUnit.mileUnit()
+            return metric ? HKUnit.meterUnitWithMetricPrefix(HKMetricPrefix.Kilo) : HKUnit.mileUnit()
 
         case HKQuantityTypeIdentifierElectrodermalActivity:
             return HKUnit.siemenUnitWithMetricPrefix(HKMetricPrefix.Micro)

@available(iOS 9.0, *)
public extension HKSampleType {

    public var defaultUnit: HKUnit? {
//        let isMetric: Bool = UserManager.sharedManager.useMetricUnits()
        let isMetric: Bool = true

        switch identifier {
        case HKCategoryTypeIdentifierSleepAnalysis:
            return HKUnit.hourUnit()

    public var defaultUnit: HKUnit? { return quantityType.defaultUnit }

    public var hkType: HKSampleType? { return quantityType }

    public func unitForSystem(metric: Bool) -> HKUnit? {
        return quantityType.unitForSystem(metric: metric)
    }
}

/*
