The round function will give you the nearest number with a given number of digits. Note that it only works for real numbers, so you should round the real and imaginary parts separately.