unitString(fromValue:unit:)
Returns the unit string based on the provided value and unit.
Declaration
func unitString(fromValue value: Double, unit: MassFormatter.Unit) -> StringParameters
- value:
The mass’s value for the provided unit.
- unit:
The unit to use in the resulting mass string.
Return Value
A localized string representing the given unit. The provided value determines whether the unit is plural or singular.