Any way to convert Float to string with out getting E (exponent).
String str = String.valueOf(floatvalue);
txtbox.settext(str);
and i am using NumericTextFilter.ALLOW_DECIMAL in my textField which allow decimal but not E.
i am getting like this 1.3453E7 but i want it something like 1.34538945213 due to e i am not able to set my value in edit text.
so any way to get value with out e.
I’m not 100% sure I understand what number you’re trying to format. In the US (my locale), the number
1.3453E7is not equal to the number1.34538945213. I thought that even in locales that used the period, or full stop (.) to group large numbers, you wouldn’t have1.34538945213. So, I’m guessing what you want here.If you just want to show
floatnumbers without theE, then you can use the Formatter class. It does not, however, have all the same methods on BlackBerry that you might expect on other platforms.You can try this:
Which will show
The
1method parameter above indicates the number of decimal places to show, and can be anything from 1 to 15. It can’t be zero, but if you wanted to display a number without any decimal places, I would assume you would be using anintor alongfor that.If I have misunderstood your problem, please post a little more description as to what you need.
I’ll also mention this utility class that apparently can be used to do more numeric formatting on BlackBerry, although I haven’t tried it myself.