scientific « bigdecimal « Java Data Type Q&A





1. How to always display a BigDecimal object in full decimal format instead of scientific notation?    stackoverflow.com

I have a BigDecimal object, myNumber, with unknown length. For example: 12345678. I always want to divide this number by 1 million, so I do:

myNumber.divide(BigDecimal.valueOf(1000000))
I get 12.345678. I want to display ...

2. converting between ordinary decimals and scientific notation with BigDecimal    coderanch.com

I am trying to convert the BigDecimal number "14563", into scientific notation, so that it will appear as, 1.4563E+4. The 'toString()' method supposedly does this, but I can't seem to get it to work. What I have tried is this:- BigDecimal someNumber = new BigDecimal("14563"); System.out.println(someNumber.toString()); I simply get, 14563, as output. What's wrong here? Also, how would you go the ...

3. BigDecimal showing scientific 0E-7 iso 0.0000000    forums.oracle.com

I could use the java.text.DecimalFormat when I need to put a value somewhere on the screen (like the textbox in the example). But what's needed to use the BigDecimal as an object in a JTable? The JTable display's it's objectvalues and the user can change these values. For a BigDecimal, the value is displayed 'right-aligned' as numbers and the user can ...