UnitType symbol is different than the symbol used by a MeasurementFormatter

Hello,


It seems that the symbol used in a UnitType is different than the one use in a string generated using a MeasurementFormatter.


let distance = Measurement(value: 233, unit: UnitLength.meters)
let unit = UnitLength.nauticalMiles
let convertedDistance = distance.converted(to: unit) // 0.126 NM
let symbol = convertedDistance.unit.symbol // "NM"

--> the symbol is "NM"


let measurementFormatter = MeasurementFormatter()
measurementFormatter.unitOptions = .providedUnit // unit is then nautical miles
let string = measurementFormatter.string(from: convertedDistance) // 0.126 nmi

--> the string is "127.645 nmi"


Is that the expected behavior?

What is the link between a UnitType symbol and the symbol used in a string ?

The symbol in the UnitType is not localized, right?


Thanks,

Axel

UnitType symbol is different than the symbol used by a MeasurementFormatter
 
 
Q