Class

MassFormatter

A formatter that provides localized descriptions of mass and weight values.

Declaration

class MassFormatter : Formatter

Overview

Topics

Formatting Mass Strings

var isForPersonMassUse: Bool

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

var numberFormatter: NumberFormatter!

The number formatter used to format the numbers in a mass strings.

func string(fromKilograms: Double) -> String

Returns a mass string for the provided value.

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

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

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

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

var unitStyle: Formatter.UnitStyle

The unit style used by this formatter.

Constants

enum MassFormatter.Unit

The units supported by the NSMassFormatter class.

Relationships

Inherits From

Conforms To

See Also

Deprecated

class LengthFormatter

A formatter that provides localized descriptions of linear distances, such as length and height measurements.

class EnergyFormatter

A formatter that provides localized descriptions of energy values.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software