When I display a floating point variable in a string, how do I force it to display a specifc number of decimal points? I'm working with currency, so I need two decimal points. Ex:
cout<< "Adults " << numAdult << " at " << adMealCost << setw(12) << totalAdultCost << "\n";
How do I make the Meal costs appear as 1.50 instead of 1.5?
cout<< "Adults " << numAdult << " at " << adMealCost << setw(12) << totalAdultCost << "\n";
How do I make the Meal costs appear as 1.50 instead of 1.5?