I have defined the following function:
randvec[mag_]:= mag Normalize[Table[RandomReal[], {j, 1, 4}]]
I would like to format the numbers in the list so that they are 4 d.p. Trying the following:
randvec[mag_] := NumberForm[mag Normalize[Table[RandomReal[], {j, 1, modes}]], 4]
casts each entry as a string. What is the appropriate way to format the list without changing the type of the entries?