Post

Replies

Boosts

Views

Activity

NSMeasurementFormatter bug?
Not sure if this is a bug in NSMeasurementFormatter or NSMeasurement. The formatter unitOption is set to NSMeasurementFormatterUnitOptionsNaturalScale. It seems to all work well unless the initial value is negative. My app initiated NSMeasurement with the double value -576 meters. The formatter then produced the string "-22,699 inches". If I initiate NSMeasurement with 576 meters, the formatter produces the string "630 yards" which is what I'd expect, except it should be -630 yards. Is this a bug? For now I detect if the initial value is negative, set it to positive, get the string, and then prepend a negative sign to it.
7
0
1.1k
Jan ’20