[openstreetmap/openstreetmap-website] Rework coordinates to avoid scientific formatting of small numbers (#1566)
notifications at github.com
Fri Jun 23 13:38:26 UTC 2017
tomhughes 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)
What's the benefit of using delegation here over just inheriting from `Float` and overriding the `to_s` method?
If we did that then I think we wouldn't need to special case the AMF encoding (because Coord would match Numeric) and we wouldn't need `to_f` on the pack etc?
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