fix formatting bug in sprintf, always convert numeric parameter to integer