Contents

unitString(fromValue:unit:)

Returns the unit string based on the provided value and unit.

Declaration

func unitString(fromValue value: Double, unit: LengthFormatter.Unit) -> String

Parameters

  • value:

    The length’s value for the provided unit.

  • unit:

    The unit to use in the resulting length string.

Return Value

A localized string representing the given unit. The provided value determines whether the unit is plural or singular.

See Also

Formatting Length Strings