Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 11
Registered: ‎11-16-2011
My Device: developer
Accepted Solution

Round a number to two decimals!

hello.

I wonder if any of you can help me with this problem, .. I need to know how I can round anumber to two decimal places.

appreciate if you can help me

Thank you!

 
 
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various

Re: Round a number to two decimals!

Do you know how to round a number to an integer? If yes, multiply your target number by 100, round it to an integer then divide the result by 100.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook

Re: Round a number to two decimals!

it sounds silly...but that's what I do too :smileyhappy:

Contributor
Posts: 11
Registered: ‎11-16-2011
My Device: developer

Re: Round a number to two decimals!

Thanks arkadyz for your help!! ............I'll try to do that!!..