Round and remove trailing zeros from JavaScript floating point types