Current location - Loan Platform Complete Network - Big data management - How to convert scientific notation to int type in java
How to convert scientific notation to int type in java
First, you need to convert scientific notation:

For example:

BigDecimal bd = new BigDecimal("3.40256010353E11");

Then convert it to a string:

String str = bd. toPlainString();

If the length of the number is in the range of int, it can be converted to int:

int a = Integer.parsInt(str);

If the length of the number is not in the range of Int, it is not the number you want! !