开发者

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

开发者 https://www.devze.com 2023-03-12 19:04 出处:网络
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).开发者_S

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

精彩评论

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