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

Refs #635
Sorry if this has been discussed before, but instead of `&num[0]` can't you simply pass `num`? :smile: