Contents

string(fromValue:unit:)

Returns a properly formatted length string for the given value and unit.

Declaration

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

Parameters

  • value:

    The length’s value in the given unit.

  • unit:

    The unit used in the resulting length string.

Return Value

A localized string that combines the provided value and unit.

See Also

Formatting Length Strings