Hello. When creating (converting) a BigDecimal object with 32 characters, I get a value of type 1.0E-30
BigDecimal delta = new BigDecimal("0.000000000000000000000000000001", mc); или так: BigDecimal delta = new BigDecimal(0.000000000000000000000000000001d, mc); BigDecimal delta = BigDecimal.valueOf(0.000000000000000000000000000001d); In general, the result is one Output: DELTA: 1.0E-30
How can I get a normal result with 30 characters (but this is not the limit)? I use JavaHome = jdk1.8_131 although at 1.8_51 the same thing Thanks in advance for the answer!
BigDecimal.valueOf(0.000000000000000000000000000001d).toPlainString()- MrFylypenkoBigDecimal.valueOf(0.000000000000000000000000000001d).toPlainString().substring(0, 32)in this case, it will really take 30 decimal places + I have solved this problem withString.format("%.30f", d)- Alex