<p>In app/helpers/geocoder_helper.rb:</p>
<pre style='color:#555'>> @@ -40,4 +40,41 @@ def describe_location(lat, lon, zoom = nil, language = nil)
> "#{number_with_precision(lat, :precision => 3)}, #{number_with_precision(lon, :precision => 3)}"
> end
> end
> +
> + def nsew_to_decdeg(captures)
> + begin
> + Float(captures[0])
> + captures[1].downcase != 's' ? lat = captures[0].to_f : lat = -(captures[0].to_f)
> + captures[3].downcase != 'w' ? lon = captures[2].to_f : lon = -(captures[2].to_f)
> + rescue
> + captures[0].downcase != 's' ? lat = captures[1].to_f : lat = -(captures[1].to_f)
> + captures[2].downcase != 'w' ? lon = captures[3].to_f : lon = -(captures[3].to_f)
> + end
> + return "#{number_with_precision(lat, :precision => 5)}, #{number_with_precision(lon, :precision => 5)}"
</pre>
<p>What's the logic behind using <code>number_with_precision</code> here rather than just putting out the whole value - it's only going to get converted back to a number anyway isn't it?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/pull/216/files#r3197490'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/uTRSc6ihLa7Shf84BpiOpswm2upcLXkvSUV9Ff7I2X2AMGIam68vFFgovLsKBb-e.gif' height='1' width='1'></p>