Replace Math.round() with simple workalike -- faster, and needed to work in JavaME