Sprintf Arduino Float Code Example


Example: arduino sprintf float

// 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"

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable