rbur004 / vincenty

Vincenty published an algorithm for calculating the distance between two latitudes and longitudes and another to find the destination latitude and longitude, given the start coordinate, bearing and distance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Float#round always returns float

ivanovv opened this issue · comments

Another issue with Float class method redefined.
Sass library calls #to_s(16) on the result of f.round. Ruby default Float behaviour is to return int when round is called without args. Since gem's float returns float, this call fails.

Is it possible to limit new Float#round to the scope of the gem?

On 4/03/15 10:05 pm, Victor Ivanov wrote:

Another issue with Float class method redefined.
Sass library calls #to_s(16) on the result of f.round. Ruby default
Float behaviour is to return int when round is called without args.
Since gem's float returns float, this call fails.

Is it possible to limit new Float#round to the scope of the gem?


Reply to this email directly or view it on GitHub
#2.

Try vincenty 1.0.7.
I have changed the round function to call the original if rounding to
0 decimal places, which will return a Fixnum.

Rob Burrowes Ph: +64 9 923 2308 (Internal 82308)
System Lead, NeSI Auckland Cell: +64 27 4731856 (internal 64209)
Research Data Services Technical Lead
Centre for eResearch
The University of Auckland
Private Bag 92019 http://www.sit.auckland.ac.nz/~rob
Auckland Mail Centre http://www.burrowes.org/
Auckland 1142 http://www.wikarekare.org/
NEW ZEALAND