Sorted proper conversion for numerical types in JSON