About vectors' format

I read the content of a file into two vectors in this way:

ifstream file1;
std::string line1;
std::vector x1, y1;

while (std::getline(file1, line1))
double x = 0., y = 0.;
sscanf (line1.c_str(), “%lf %le\n”, &x, &y);
printf("%.12lf %.17le\n", x, y); //print on screen
x1.push_back(x); //fill vectors

When I print them on screen I can specify the format I want so as they are seen exactly as they are in the file;
but when I use “push_back” to fill the vectors I loose the original format and x1 and y1 are approximated in a way that is not useful for my subsequent calculations.
How can I pass the original format to x1 and y1?
Thanks in advance!

Dear Elena,

your question is not ROOT related.
In any case your numbers are and stay double precision floating point, stored in 64 bits
en.wikipedia.org/wiki/Floating_p … _computers
the information you have in the vector is independent from the number of digits you decide to display.