2

Playing around with swift measurements, I have come across a questionable value conversion. As illustrated below kg to lb is correct, but the same kilogram to stone conversion is not correct, unless I'm not understanding the conversion correctly.

let pounds = Measurement(value: 75, unit: UnitMass.kilograms).converted(to: UnitMass.pounds) // 165.34... lb (correct)
let stones = Measurement(value: 75, unit: UnitMass.kilograms).converted(to: UnitMass.stones) // 476.272... st (should be 11.81)
Nauman Malik
  • 1,326
  • 9
  • 27
  • It seems that it is a bug. I already reported an issue -so you don't have to report one-, that's the [link](https://bugs.swift.org/browse/SR-4199) if you are interested in watching it. – Ahmad F Mar 08 '17 at 23:52
  • @AhmadF Thanks. I already raised the issue but will close it as yours is being looked into. –  Mar 09 '17 at 09:44

1 Answers1

2

In the UnitMass class reference it lists a stone = 0.157473kg, it is not a frequently used property so it probably has not been noticed as of yet.

  • Yes, it looks like the coefficient used to calculate the conversion is incorrect, thanks. I will submit a bug report. –  Mar 08 '17 at 22:34