@@ -834,17 +834,20 @@ static int json_object_double_to_json_string_format(struct json_object* jso,
834834 if (format == std_format || strstr (format , ".0f" ) == NULL )
835835 format_drops_decimals = 1 ;
836836
837- if (size < (int )sizeof (buf ) - 2 &&
838- isdigit ((int )buf [0 ]) && /* Looks like *some* kind of number */
839- !p && /* Has no decimal point */
840- strchr (buf , 'e' ) == NULL && /* Not scientific notation */
841- format_drops_decimals )
842- {
843- // Ensure it looks like a float, even if snprintf didn't,
844- // unless a custom format is set to omit the decimal.
845- strcat (buf , ".0" );
846- size += 2 ;
847- }
837+ // Commented out to fix GitHub #572 https://github.com/multitheftauto/mtasa-blue/issues/572
838+ // Before toJSON(1234567890000) => [ 1234567890000.0 ]
839+ // After toJSON(1234567890000) => [ 1234567890000 ]
840+ //if (size < (int)sizeof(buf) - 2 &&
841+ // isdigit((int)buf[0]) && /* Looks like *some* kind of number */
842+ // !p && /* Has no decimal point */
843+ // strchr(buf, 'e') == NULL && /* Not scientific notation */
844+ // format_drops_decimals)
845+ //{
846+ // // Ensure it looks like a float, even if snprintf didn't,
847+ // // unless a custom format is set to omit the decimal.
848+ // strcat(buf, ".0");
849+ // size += 2;
850+ //}
848851 if (p && (flags & JSON_C_TO_STRING_NOZERO ))
849852 {
850853 /* last useful digit, always keep 1 zero */
0 commit comments