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
New Contributor
Posts: 3
Registered: ‎07-27-2009
My Device: Storm

Re: How to convert double to String without scientific notation.

Speaking of rounding errors...

 

I discovered one worthy of note using the method posted above. Using a value of 12345678.012 results in 12345678.1 instead of 12345678.01.

 

The remainder calculation treats the first digit after the decimal point as a leading zero after the decimal moves to the right.

 

B

Highlighted
Developer
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Re: How to convert double to String without scientific notation.

i tried to find a solution to convert double to string and found out that, the following code solved the issue for me.. Any thing you guys can think of whcih might not work with this solution?

 

	Formatter format = new Formatter();
       format.formatNumber(doublevalue, 2);