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

Refs #635
Is there a reason why we can't simply use the definitions in `<float.h>` directly instead of relying on the highest number found so far?