I have a set of lists in any iteration
list[1]={{0.129627, 0.74633, 0.93636, 0.328093, 0.323795},{0.24651, 0.15002, 0.341932, 0.0734819, 0.596785}, {0.381849, 0.798165, 0.847398, 0.619787, 0.663031}};
list[2]={{0.577629, 0.756704, 0.330815, 0.873377, 0.268678},{0.0456685, 0.320828, 0.541756, 0.116326, 0.683982}};
list[3]={{0.7495, 0.513172, 0.882195, 0.184402, 0.442981}};
As it can be seen the Dimensions
of every list is different from another. But I wish to apply the PaddedForm[#,{2,3}]
to each number contained in a list. The desired results must be for example:
list[1]={{0.130, 0.750, 0.940, ...},{0.250, .....}, {0.390,....}};
.etc
I tried PaddedForm[#,{2,3}]&list[1]
but it does not work. As long as I am not sure to use Map
or Mapthread
because in each iteration, the Dimension
of the list is changing!
Map
at{-1}
level, check 3rd argument ofMap
. Or createListable
function. $\endgroup$ – Kuba♦ Jun 22 '17 at 10:53PaddedForm
will work applied globally too, you just forgot@
, check:PaddedForm[#, {2, 3}] &@list[1]
$\endgroup$ – Kuba♦ Jun 22 '17 at 11:030.000
? because for another list which is not written here I have0.000
after applying that. For a number that results in as0.000
it should be written0
. $\endgroup$ – Unbelievable Jun 22 '17 at 11:06If
. or replace0
with"0"
before PaddedForm $\endgroup$ – Kuba♦ Jun 22 '17 at 11:09