Just use `%ld` format string instead of casting to an int.