Contents

unitString(fromMeters:usedUnit:)

Returns the unit string for the provided value.

Declaration

func unitString(fromMeters numberInMeters: Double, usedUnit unitp: UnsafeMutablePointer<LengthFormatter.Unit>?) -> String

Parameters

  • numberInMeters:

    The length’s value in meters.

  • unitp:

    An output parameter. This will hold the Unit value that corresponds to the returned units.

Return Value

A localized string representing the unit.

Discussion

This method selects the correct unit based on the formatter’s locale, the magnitude of the value, and the isForPersonHeightUse property.

See Also

Formatting Length Strings