Heim > Fragen und Antworten > Hauptteil
water_alarm_source['analog_value'] = int(str(i['analog_value1']))/1000
其中 i['analog_value1'] 取出来的类型为 unicode,想要转换成int类
错误:
"data": "invalid literal for int() with base 10: '100.0'"
黄舟2017-04-18 10:20:09
water_alarm_source['analog_value'] = float(str(i['analog_value1']))//1000