Fixed bug #50224 where float without decimals were converted to integer when encode to JSON

Refs #635
I would like to hear the opinion from @bukka and @smalyshev about it. Since they suggested me to do this way.