dewski / json_builder

Rails provides an excellent XML Builder by default to build RSS and ATOM feeds, but nothing to help you build complex and custom JSON data structures. JSON Builder is here to help.
http://garrettbjerkhoel.com/json_builder/
MIT License
244 stars 52 forks source link

Decimal numbers dissapear #2

Closed dbackeus closed 12 years ago

dbackeus commented 13 years ago
json = JSONBuilder::Generator.new
json.float = 1.3
json.compile! # "{\"float=\": }"
agileapplications commented 13 years ago

+1, same here

dewski commented 12 years ago

The issue here is you are using json.float = 1.3 as a setter, if you remove the = you would get expected results. The new API in 3.0 should help as well.