Examples - HowTo - Number to String

How to convert numbers to strings

 This Code Snippet shows a avr convert method.



// Number to String Method by using avr commands
// By Christoph Wartmann

double number = 50.45; // Your Number
char string[20];


void setup()
{
        Serial.begin(9600);
        Serial.println(dtostrf(number,1,3,string)); // the 3 stands for: how many digits after the comma
}


void loop()
{
        delay(200);
}





This website has been archived and is no longer maintained.