# and not e.g. 4.0e-05
# Unfortunately you can't extend Numeric classes directly (e.g. `Coord < Float`).
class Coord < DelegateClass(Float)
- def initialize(obj)
- super(obj)
- end
-
def to_s
- format("%.7f", self)
+ format("%<coord>.7f", :coord => self)
end
def as_json(_)
- format("%.7f", self).to_f
+ format("%<coord>.7f", :coord => self).to_f
end
end