change number of decimals of all numbers in a list

Mar 13, 2012 at 10:30pm

change number of decimals of all numbers in a list

say that I got a very long list with 100 float numbers with 6 decimals. Is it possible to change the whole list at once so it only contains two decimals instead?

for example in a list like the one below:
0.188235 0.309804 0.160784 0.364706 0.556863 0.407843 0.101961 0.14902 0.270588 0.192157 0.258824 0.282353 0.262745 0.262745 0.286275 0.270588 0.196078 0.286275 0.14902 0.407843 0.560784 0.141176 0.384314 0.015686 0.294118 0. 0.243137 0.286275 0.27451 0.333333 0.25098 0.235294 0.247059 0.078431 0.133333 [...]

thanks

#62362
Mar 13, 2012 at 10:35pm

found one:
[round 0.1]

#225274

You must be logged in to reply to this topic.