Skip to content

dtosrtf doesn't pad to desired width #475

Closed
@mikemacwillie

Description

@mikemacwillie

The dtostrf implementation seems to be missing the leading space padding of the AVR variant. The padding is very helpful when doing things like updating LCDs.

On the 328P the following test code prints ' 17.0105' , and on the ESP8266 it prints '17.0105'.

float input = 17.0105;
char val[12];

void setup() {
Serial.begin(115200);
dtostrf(input, 11, 4, val);
Serial.print("'");
Serial.print(val);
Serial.println("'");

}

void loop() {

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions