You can just inline this:
pricingOutputFile << std::fixed
<< std::setw(11)
<< std::setprecision(6)
<< std::setfill('0')
<< rowMin;
But that is very imperative. I always like to stay declarative as long as possible. One simple way to do this would be:
void StreamPriceToFile(ofstream & output, const double & price) const
{
output << std::fixed
<< std::setw(11)
<< std::setprecision(6)
<< std::setfill('0')
<< price;
}
//wherever used
StreamPriceToFile(pricingOutputFile, rowMin);
But even better (in my opinion) would be something like:
//setup stream to receive a price
inline ios_base& PriceFormat(ios_base& io)
{
io.fixed(...);
...
}
//wherever used
pricingOutputFile << PriceFormat << rowMin;
My C++ is very rusty or I'd fill in PriceFormat.