I need to store 17774132 in a double format, but it seems that double is to small since I get 1.7774132E7.
How can I overcome this problem? I need some kind of prim
First, hopefully you recognize the issues with floating-point decimal representations.
17774132
is equivalent to 1.7774132E7
; the "E7" means it is being multiplied by 10^7
. If your issue is that you want it displayed differently, you can use a NumberFormat.
Note that 17774132
is actually an integer and well below the threshold of ~2.1 billion for the int
primitive type. The long
primitive type lets you go even higher if you are actually using integers.
If you want to represent the number differently and it is not an integer, you can try BigDecimal (or BigInteger for legitimate integers too big for a long).