for (int i = 0; i < c.length; i++) { if (c[i] == null){ c[i] = ""; } c[i] += currency + " || "+prodaja + " || " + bidPrice + " || "+ commercial+ "\n"; } if (c[2] != null||(c[5]!=null)||(c[6]!=null)){ c[2]=currency + " || "+prodaja +" || "+ bidPrice +" || " +commercial; } } for (int i = 0; i < 1; i++) { System.out.print(c[i]); } Displays these values, but RUB, PLN, JPY, DKK and so on are not formatted.
USD || 28.082 -0.050 || 27.761 -0.033 || 28.0195 27.930020 EUR || 32.607 -0.090 || 31.970 -0.085 || 32.3292 32.362514 RUB || 0.436 +0.003 || 0.372 +0.004 || 0.4288 0.426210 GBP || 37.380 -0.066 || 35.676 -0.088 || 36.8098 36.946462 CHF || 28.560 -0.092 || 27.101 -0.130 || 28.2307 28.279023 PLN || 7.638 +0.015 || 7.083 +0.050 || 7.5686 7.545468 JPY || 0.251 || 0.239 +0.001 || 0.2497 0.249096 CAD || 21.950 +0.265 || 20.450 +0.800 || 21.5661 21.560636 AUD || 20.330 +0.030 || 19.500 +0.070 || 19.9768 19.923976 DKK || 4.370 || 4.100 || 4.3496 4.337615 NOK || 3.460 +0.020 || 3.280 || 3.4203 3.435584 SEK || 3.160 +0.010 || 2.970 || 3.1315 3.136966 CZK || 1.297 || 1.193 || 1.2570 1.253341 HUF || 0.104 +0.001 || 0.091 || 0.1008 0.100486 That is, I want the output of the array to be such (that is, that the separators (||) are placed one below the other:
USD || 28.082 -0.050 || 27.761 -0.033 || 28.0195 27.930020 EUR || 32.607 -0.090 || 31.970 -0.085 || 32.3292 32.362514 RUB || 0.436 +0.003 || 0.372 +0.004 || 0.4288 0.426210 GBP || 37.380 -0.066 || 35.676 -0.088 || 36.8098 36.946462 CHF || 28.560 -0.092 || 27.101 -0.130 || 28.2307 28.279023 PLN || 7.638 +0.015 || 7.083 +0.050 || 7.5686 7.545468 JPY || 0.251 || 0.239 +0.001 || 0.2497 0.249096 CAD || 21.950 +0.265 || 20.450 +0.800 || 21.5661 21.560636 AUD || 20.330 +0.030 || 19.500 +0.070 || 19.9768 19.923976 DKK || 4.370 || 4.100 || 4.3496 4.337615 NOK || 3.460 +0.020 || 3.280 || 3.4203 3.435584 SEK || 3.160 +0.010 || 2.970 || 3.1315 3.136966 CZK || 1.297 || 1.193 || 1.2570 1.253341 HUF || 0.104 +0.001 || 0.091 || 0.1008 0.100486 Tell me how to fix it, advise something