Skip to content

String class not behaving as expected with Print class on M0+ #4584

@tigoe

Description

@tigoe

Initializing a String object with a float and then printing it fails on the M0+ platform.

Try this:

void setup() {
Serial.begin(9600);
}

void loop() {
  float foo = 3.14159269;
  String fee = String(foo, 2);
  Serial.print(foo, 5);
  Serial.print(" ");
  Serial.println(fee);
}

This should produce

3.14159 3.14

Instead it only produces
3.14159

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions