user45247: Here’s the code:
void setup()
{
    Serial.begin(9600);
    delay(300);

    double lat = 1111.11;
    double lon = 4444.44;

    const byte len{10};

    char sLat[len];
    char sLon[len];

    dtostrf(lat, len, 2, sLat);
    Serial.println(sLat);

    Serial.println("---");

    dtostrf(lon, len, 2, sLon);
    Serial.println(sLon);
    Serial.println(sLat); // <-- prints nothing!

    Serial.println("---");

    dtostrf(lat, len, 2, sLat);
    Serial.println(sLat);
    Serial.println(sLon); // <-- prints nothing!
}

void loop()
{
}

Here’s the output:
   1111.11
---
   4444.44

---
   1111.11
   4444.44   1111.11

As you see. Every next call for dtostrf ruins the previous results, in a weird way.
What’s the problem?

user16780: If len is the text array size, you need space there for the terminating '\0'.
So the second paramater to dtostrf has to be smaller than len.

45247: <p><strong>Here’s the code:</strong></p>

<pre><code>void setup()
{
    Serial.begin(9600);
    delay(300);

    double lat = 1111.11;
    double lon = 4444.44;

    const byte len{10};

    char sLat[len];
    char sLon[len];

    dtostrf(lat, len, 2, sLat);
    Serial.println(sLat);

    Serial.println("---");

    dtostrf(lon, len, 2, sLon);
    Serial.println(sLon);
    Serial.println(sLat); // &lt;-- prints nothing!

    Serial.println("---");

    dtostrf(lat, len, 2, sLat);
    Serial.println(sLat);
    Serial.println(sLon); // &lt;-- prints nothing!
}

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

<p><strong>Here’s the output:</strong></p>

<pre><code>   1111.11
---
   4444.44

---
   1111.11
   4444.44   1111.11
</code></pre>

<p>As you see. Every next call for <code>dtostrf</code> ruins the previous results, in a weird way.</p>

<p>What’s the problem?</p>
 16780: <p>If <code>len</code> is the text array size, you need space there for the terminating '\0'.
So the second paramater to <code>dtostrf</code> has to be smaller than <code>len</code>.</p>
