<p></p>
<p><b>@AntonKhorev</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5147#discussion_r1747833440">app/controllers/geocoder_controller.rb</a>:</p>
<pre style='color:#555'>> -
-    ew = captures.fetch("ew").casecmp?("w") ? -1 : 1
-    ewd = BigDecimal(captures.fetch("ewd", "0"))
-    ewm = BigDecimal(captures.fetch("ewm", "0"))
-    ews = BigDecimal(captures.fetch("ews", "0"))
-
-    lat = ns * (nsd + (nsm / 60) + (nss / 3600))
-    lon = ew * (ewd + (ewm / 60) + (ews / 3600))
-
-    { :lat => lat.round(6).to_s("F"), :lon => lon.round(6).to_s("F") }
+  def dms_to_decdeg(prefix, directions, captures)
+    extract_number = ->(suffix) { captures.fetch("#{prefix}#{suffix}", "0").sub(",", ".") }
+
+    positive_direction, negative_direction = directions.chars
+    sign = captures.fetch(prefix, positive_direction).casecmp?(negative_direction) ? "-" : ""
+    deg = if captures["#{prefix}m"] || captures["#{prefix}s"]
</pre>
<p dir="auto">Because we don't need to do min/sec math with divisions and results that have to be rounded to some precision. This special case was previously here: <a href="https://github.com/openstreetmap/openstreetmap-website/blob/1fce0c00f12ac6bbb56ad7c05c8c9f53c0d6edb3/app/controllers/geocoder_controller.rb#L213-L214">https://github.com/openstreetmap/openstreetmap-website/blob/1fce0c00f12ac6bbb56ad7c05c8c9f53c0d6edb3/app/controllers/geocoder_controller.rb#L213-L214</a> except it was triggered not by a lack of min/sec but by the entire query being in a simplest format possible. So you had <a href="https://www.openstreetmap.org/search?query=1.1111111111%202.2222222222" rel="nofollow">1.1111111111 2.2222222222</a> keeping lat/lon intact but <a href="https://www.openstreetmap.org/search?query=1.1111111111%20N%202.2222222222%20E" rel="nofollow">1.1111111111 N 2.2222222222 E</a> going into math mode with rounding.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5147#discussion_r1747833440">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ2RG5X37GDH4PL2TLZVJBERAVCNFSM6AAAAABNPLEZFKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOBXGI4DSMRYGM">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOP7J4SDIWGX66DJ23ZVJBERA5CNFSM6AAAAABNPLEZFKWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUIKVB4G.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5147/review/2287289283</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5147#discussion_r1747833440",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5147#discussion_r1747833440",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>