lundi 27 juillet 2015

Print a double(> than 17 digits) value without E notaion in Java

I have a requirement of printing a 22 digit number, but when i print it, JVM is using E notation. I have tried BigDecimal class, printf(), String.Format(), but I didn't succeed. All I get is accurate till 17 digits, from 18th digit data is manipulated. For example:

original number : 2333333333333333333333 output: 2333333333333333456252

Aucun commentaire:

Enregistrer un commentaire