user26074: I have a LCD that displays a float variable. I would like to show a comma instead of a dot as the decimal separator.
float temp = 23.50;
lcd.setCursor(0, 0);
lcd.print(temp);

I want to show 23,50 instead of 23.50.
Is there any function to convert or format it?

user-1: Due to some performance reasons %f is not included in the Arduino's implementation of sprintf(). A better option would be to use dtostrf() - you convert the floating point value to a C-style string, Method signature looks like:
char *dtostrf(double val, signed char width, unsigned char prec, char *s)

Demo
void setup() {
  Serial.begin(9600);
  while(!Serial);

  float a = 12.34;
  char buffer[] = "9999.99";
  dtostrf(a, 4, 2, buffer);
  char* p  = strchr(buffer, '.');
  *p = ',';
  Serial.println(buffer);
}

void loop() {

}

The strchr search for the first ocurrence of second arg ('.' in this case) and return a pointer to that char. You then use that pointer to sustitute '.' with ','.
You have the final string in buffer, where you can use it for whatever purpose you fancy.
Caution: You have to reserve space (buffer) to hold your biggest value.

user7508: May be overkill for this simple usage but, if you are printing numbers
in more than one place in your program, it may be convenient to
implement a filter that replaces all dots with commas.
Here is one such filter:
// Replace dots with commas.
class CommaForDot : public Print
{
public:
    CommaForDot(Print &downstream) : downstream(downstream) {}
    virtual size_t write(uint8_t c) {
        return downstream.write(c=='.' ? ',' : c);  // replacement
    }
private:
    Print &downstream;
};

And here is a simple test:
void setup()
{
    Serial.begin(9600);
    float a = 12.34;

    Serial.print("Through Serial:      ");
    Serial.println(a);

    CommaForDot filteredSerial(Serial);
    Serial.print("Through CommaForDot: ");
    filteredSerial.println(a);
}

void loop(){}

The output is:
Through Serial:      12.34
Through CommaForDot: 12,34


user4143: Print the integer part, print a comma, then print the value minus the integer part.
float value = 123.45;
int ival = (int)value;
int frac = (value - ival) * 100;

Serial.print(ival);
Serial.print(",");
if (frac < 10) Serial.print("0");
Serial.println(frac);


26074: <p>I have a LCD that displays a float variable. I would like to show a comma instead of a dot as the decimal separator.</p>

<pre><code>float temp = 23.50;
lcd.setCursor(0, 0);
lcd.print(temp);
</code></pre>

<p>I want to show <strong>23,50</strong> instead of <strong>23.50</strong>.</p>

<p>Is there any function to convert or format it?</p>
 -1: <p>Due to some performance reasons %f is not included in the Arduino's implementation of sprintf(). A better option would be to use dtostrf() - you convert the floating point value to a C-style string, Method signature looks like:</p>

<pre><code>char *dtostrf(double val, signed char width, unsigned char prec, char *s)
</code></pre>

<p><strong>Demo</strong></p>

<pre><code>void setup() {
  Serial.begin(9600);
  while(!Serial);

  float a = 12.34;
  char buffer[] = "9999.99";
  dtostrf(a, 4, 2, buffer);
  char* p  = strchr(buffer, '.');
  *p = ',';
  Serial.println(buffer);
}

void loop() {

}
</code></pre>

<p>The <code>strchr</code> search for the first ocurrence of second arg ('.' in this case) and return a pointer to that char. You then use that pointer to sustitute '.' with ','.</p>

<p>You have the final string in buffer, where you can use it for whatever purpose you fancy.</p>

<p>Caution: You have to reserve space (buffer) to hold your biggest value.</p>
 7508: <p>May be overkill for this simple usage but, if you are printing numbers
in more than one place in your program, it may be convenient to
implement a filter that replaces all dots with commas.</p>

<p>Here is one such filter:</p>

<pre class="lang-c++ prettyprint-override"><code>// Replace dots with commas.
class CommaForDot : public Print
{
public:
    CommaForDot(Print &amp;downstream) : downstream(downstream) {}
    virtual size_t write(uint8_t c) {
        return downstream.write(c=='.' ? ',' : c);  // replacement
    }
private:
    Print &amp;downstream;
};
</code></pre>

<p>And here is a simple test:</p>

<pre class="lang-c++ prettyprint-override"><code>void setup()
{
    Serial.begin(9600);
    float a = 12.34;

    Serial.print("Through Serial:      ");
    Serial.println(a);

    CommaForDot filteredSerial(Serial);
    Serial.print("Through CommaForDot: ");
    filteredSerial.println(a);
}

void loop(){}
</code></pre>

<p>The output is:</p>

<pre><code>Through Serial:      12.34
Through CommaForDot: 12,34
</code></pre>
 4143: <p>Print the integer part, print a comma, then print the value minus the integer part.</p>

<pre><code>float value = 123.45;
int ival = (int)value;
int frac = (value - ival) * 100;

Serial.print(ival);
Serial.print(",");
if (frac &lt; 10) Serial.print("0");
Serial.println(frac);
</code></pre>
