Consider the list
{
{1 , 38.58367},
{2 , 95.837674},
{3 , 84,183247},
{4 , 20.286123},
}
I want to use NumberForm[#,3]
on the "second column" only so to get
{
{1 , 38.6},
{2 , 95.8},
{3 , 84,1},
{4 , 20.2},
}
I.e.,
NumberForm[38.58367,3]
(*38.6*)
NumberForm[95.837674, 3]
(*95.8*)
etc.
How can I do that?
I saw the documentation for MapAt
which says something a bit close:
Map f onto the second element of all top-level parts (the "second column"):
MapAt[f, {{a, b, c}, {d, e}}, {All, 2}]
(*{{a, f[b], c}, {d, f[e]}}*)
But I don't think it helps because NumberForm doesn't have an "Operator form".
Any help would be appreciated!