Turf: bug(helpers): convertLength with yards is not correct

Created on 16 Mar 2020  路  2Comments  路  Source: Turfjs/turf

Problem: helper convertLength with unit yards

The following code

convertLength(1, 'meters', 'yards'); // =>  0.91441111923921
convertLength(1, 'yards', 'miles'); // => 0.0006795315358307484

returns incorrect values.

1 meter equals 1.0936132983 yards.
Instead the helper returns 0.91441111923921 yards.

1 yards equals 0.0005681818 miles.
Instead the helper returns 0.0006795315358307484 miles.

Same issue with trying to convert any other Unit with/from yards.

As I did not find any open/closed issue on this topic, I am wondering if I have missed something with the correct usage?

Thanks

bug

All 2 comments

Thanks for the report @lisabaut , does seem curious that it's never been picked up - perhaps your the first person ever to calculate a distance in yards 馃槀

There's an open PR for this here: https://github.com/Turfjs/turf/pull/1837

Was this page helpful?
0 / 5 - 0 ratings