it depends on the number of "decimal component" that you have in the data.
std :: numeric_limits :: digits10 will give the maximum number of "floating component"
ios_base :: precision indicates the number of digits (decimal + floating components) to display.
if your decimal component is always less than 100 (-99 to 99), the code below always gives maximum precision.
ss.precision(std::numeric_limits<double>::digits10 + 2);