Formating DEC in Serial.printf

Is the a way to format the decimal number outputted by Serial.println?
in the example below you see the outputs look like this:
3.1415926536
3.1415900000

but I would like them to look like this:
3.1415926
3.14159
in C++ you can format the output with formatting codes however I only see DEC as the decimal format with no additional arguments for number of digits.

#include <stdio.h>

boolean firsttime;
double value = 3.1415926535898;
double value2 =3.14159;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
firsttime= true;
}

void loop() {
// put your main code here, to run repeatedly:
if(firsttime==true){
firsttime=false;

Serial.println(value, DEC);
Serial.println(value2, DEC);
}
}

Serial.println(value, 7); 
  Serial.println(value2, 5);

You are misusing DEC there.

#define DEC 10

So that gives you 10 decimal places.

double value = 3.1415926535898;
double value2 =3.14159;

void setup() {
  Serial.begin(115200);
  Serial.println(value, 7);
  Serial.println(value2, 5);
}

void loop() { }

That prints:

3.1415927
3.14159

(edit) Ninja'd! :wink:

Thanks that explains it.