[openstreetmap/openstreetmap-website] Avoid use of scientific notation in geocoder results (PR #4961)

Tom Hughes notifications at github.com
Sun Jul 7 14:09:28 UTC 2024


This fixes #4950 by modifying the geocoder to avoid printing results in scientific notation.

The main fix is simply to avoid converting the user entered string to numeric format and back but for DMS style inputs we need to convert them to numeric form so we can do calculations so we use bigdecimal rather than float as it can force fixed precision format when converting to a string.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4961

-- Commit Summary --

  * Preserve lat and lon values as entered for reverse searches
  * Use named captures to simplify latlon parsing
  * Use bigdecimal to avoid scientfic notation in DMS decoding

-- File Changes --

    M .rubocop_todo.yml (2)
    M app/controllers/geocoder_controller.rb (79)
    M test/controllers/geocoder_controller_test.rb (8)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4961.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4961.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4961
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4961 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240707/5f247904/attachment.htm>


More information about the rails-dev mailing list