|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Integer array to double?
another novice question, but i just dont know how to figure it out.
if you have an array of integers. say... 1, 2, 3, 4, 5, 6, 7. how do i convert that to one decimal double? eg 0.1234567 ??? thanks in advance for helping me out. |
|
#2
|
|||
|
|||
|
int[] i = {1,2,3,4,5,6,7};
StringBuilder s = new StringBuilder("0."); for (int x : i) { s.append(x); } double d = Double.parseDouble(s.toString()); System.out.println(d); Is that the kind of conversion you are looking for? |
|
#3
|
|||
|
|||
|
yeah, appreciate your help
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Integer array to double? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|