I have a float variable, obj[“time”], which represents the unix time, previously I write the result to a text file, so I could use
fd_out.write("%.6f\n" %(obj["time"]))
to force the result to have 6 decimal. But now I want to print the result into csv file instead, so I used:
writer.writerow((obj["time"]))
the result only have 2 decimal by default, how could I change it?
Using an intermediate format should solve your problem, like this example: