]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/concerns/geo_record.rb
Unify lat/lon formatting for json output
[rails.git] / app / models / concerns / geo_record.rb
index 91533ece438f89fd9cf8440bfd5400d84ad9addf..447ee19df61050e83f229619db8968351498a62a 100644 (file)
@@ -12,6 +12,10 @@ module GeoRecord
     def to_s
       format("%.7f", self)
     end
+
+    def as_json(_)
+      format("%.7f", self).to_f
+    end
   end
 
   # This scaling factor is used to convert between the float lat/lon that is