"Round" float to one decimal place for printing to OLED

There are other solutions, but I don't know if you will find them more streamlined or not. Making a buffer with dtostrf() is quite streamlined in my view.

However:
First, you have to decide whether you want rounding or truncating, because they are not the same thing. Then, you can take an approach along these lines:

  1. Multiply the float by 10 and cast it to an integer called foo (this will truncate it).
  2. Compute the integer part as int integer = foo / 10
  3. Compute the decimal part as int decimal = foo % 10
  4. Print integer, followed by the decimal separator of your choice (point or comma), followed by decimal.

If you require rounding, you'll have to take extra steps. Also consider whether your floats will always be positive or if they may be negative too.

Note: You can combine steps 2-4 by sprintf()-ing everything into a buffer but at this point... just use dtostrf() and it will also round the number for you.