[openstreetmap/openstreetmap-website] Rework coordinates to avoid scientific formatting of small numbers (#1566)
notifications at github.com
Fri Jun 23 14:58:20 UTC 2017
gravitystorm commented on this pull request.
> module GeoRecord
+ # Ensure that when coordinates are printed that they are always in decimal degrees,
+ # and not e.g. 4.0e-05
+ # Unfortunately you can't extend Numeric classes directly (e.g. `Coord < Float`).
+ class Coord < DelegateClass(Float)
Do you mean something like `Coord < Float`? Ruby (or MRI, specifically) doesn't let you do that unfortunately, see e.g. http://www.virtuouscode.com/2011/08/17/you-cant-subclass-integers-in-ruby/ or http://flylib.com/books/en/22.214.171.124/1/ . In short, some built-in classes are special-cased and don't behave like normal ruby classes. The delegate library is there to provide an alternative approach.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rails-dev