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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Contributor
TechManBob
Posts: 3
Registered: ‎07-27-2009

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

Please use plain text.
Developer
rihan007
Posts: 449
Registered: ‎01-14-2009

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);

 

Please use plain text.