Correct truncation to handle floats correctly