Im having a trouble here.
I have this data, "VALOR" is float:
Periodo | VALOR |
---|---|
32021 | 1096.14 |
32021 | 3835.44 |
32021 | 2207.90 |
32021 | 389.10 |
I'm trying to change dot to comma, and that ok.
But I need to save the 2 decimals, and when I convert it, it desappear when the last decimal is 0.
df['VALOR'] = np.round(df['VALOR'], decimals=2).astype(str)
df['VALOR'] = df['VALOR'].str.replace('.',',')
df.head()
Periodo | VALOR |
---|---|
32021 | 1096,14 |
32021 | 3835,44 |
32021 | 2207,9 |
32021 | 389,1 |
How to get the 2 decimals here?
Regards,
Tanai