1

User Image Python - String Operations Jan. 7, 2016, 10:26 a.m.

Fastest way to construct a string :

text = "%d,C100,%s,,%s,V101,%s,0,1,#" % (self.message_counter, str(self.device_id), time_str, data_list[5]))

 

Rounding a float:

'%.5f' % .12345678

 


1