I need a rounding function in J2ME. Math.round () does not seem to exist. Please help!
Or you can use a different 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() possible, but they are only available again for CLDC 1.1 :)
Math.ceil() or Math.floor()
Source: https://habr.com/ru/post/1790636/More articles:"SEVERE: SAAJ0009: error sending message" when sending a message - javaPaste only if value does not exist - phpDecimalFormat problem throws a StackOverFlowError? - javaHide view with only one result? - drupal/sbin/ldconfig.real: cannot stat / lib / x86_64-linux-gnu - ubuntuObjective-C 2.0: Inheriting Synthesized Instance Variables - objective-cUnit testing approves duplication - unit-testingHow to change the value of a query string parameter using redirection? - redirectсериализовывать экземпляры scipy rv_continuous и rv_discrete подклассов - pythonHow to achieve true modularity of the application using Akka in OSGi packages? - scalaAll Articles