开发者

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). 开发者_StackOverflowanyway to avoid the exponent?


See String.format documentation.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜