john
john

Reputation: 1

how to avoid exponents in android eclipse calculation results in a text string?

in android eclipse sometimes a calculation result for both double and float when displayed as a string uses a decimal point (desired) but sometimes using an exponent (bad - confusing to user). anyway to avoid the exponent?

Upvotes: 0

Views: 571

Answers (1)

trutheality
trutheality

Reputation: 23465

See String.format documentation.

Just set the desired format for your numbers. You probably want String.format("%f",number).

Upvotes: 1

Related Questions