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