📅  最后修改于: 2022-03-11 14:44:55.189000             🧑  作者: Mango
// On arduino, sprintf does not support formatting floats, but it can be done
// with some simple integer formatting:
float f = 3.14;
sprintf(str, "Float value: %d.%02d", (int)f, (int)(fabsf(f)*100)%100);
// str will now be: "Float value: 3.14"