Instance Method

unitStringFromMeters:usedUnit:

Returns the unit string for the provided value.

Declaration

- (NSString *)unitStringFromMeters:(double)numberInMeters usedUnit:(NSLengthFormatterUnit *)unitp;

Parameters

numberInMeters

The length’s value in meters.

unitp

An output parameter. This will hold the NSLengthFormatterUnit 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 forPersonHeightUse property.

See Also

Formatting Length Strings

forPersonHeightUse

A Boolean value that indicates whether the resulting string represents a person’s height.

- getObjectValue:forString:errorDescription:

This method is not supported for the NSLengthFormatter class.

numberFormatter

The number formatter used to format the numbers in length strings.

- stringFromMeters:

Returns a length string for the provided value.

- stringFromValue:unit:

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

- unitStringFromValue:unit:

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

unitStyle

The unit style used by this formatter.