Is there a round off function in J2ME?
I need roundoff function in J2ME. Math.round() does n开发者_如何学编程ot seem to exist. Please provide some assistance!
Or you can use another approach:
float value;
int base; //base to round
int round_down=(int )((int )(value/base))*base;
int round_up=(int )((int )(value/base+0.5))*base;
Math.ceil() or Math.floor()
probably but these again are available only for CLDC 1.1 :)
精彩评论