diff options
Diffstat (limited to 'lib/json/pure/parser.rb')
-rw-r--r-- | lib/json/pure/parser.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/json/pure/parser.rb b/lib/json/pure/parser.rb index 3a6343b..5340296 100644 --- a/lib/json/pure/parser.rb +++ b/lib/json/pure/parser.rb @@ -197,7 +197,15 @@ module JSON def parse_value case when scan(FLOAT) - @decimal_class && @decimal_class.new(self[1]) || Float(self[1]) + if @decimal_class then + if @decimal_class == BigDecimal then + BigDecimal(self[1]) + else + @decimal_class.new(self[1]) || Float(self[1]) + end + else + Float(self[1]) + end when scan(INTEGER) Integer(self[1]) when scan(TRUE) |