I am trying to use numpy.around to format a vector of floats so that each value has exactly two decimals. However, when the last digit is 0, it automatically omits it.
For example, when I have the following code
import numpy as np
a = np.array([ 56.8313253 , 385.30120482, 6.65060241, 126.62650602,
85.75903614, 192.72289157, 112.80722892, 10.55421687 ])
np.around(a,decimals=2)
I receive the following result, where the second number has only one digit.
array([ 56.83, 385.3 , 6.65, 126.63, 85.76, 192.72, 112.81,
10.55])
Is there any way that I can always keep the 0 at the end? This is needed for publication purpose, and adding the 0s by hand is too tedious because I have numerous cases like this.