#include <iomanip>
#include <iostream>
#include <sstream>

using namespace std;

auto to_string_precision(double amount, int precision)
{
	stringstream stream;
	stream << fixed << setprecision(precision) << amount;
	return stream.str();
};

int main()
{
	double amount = 10000.0f;
	double rateMonthly =  0.10;

	cout << setw(25) << left << "Loan amount:" << setw(10) << right << ("$ " + to_string_precision(amount, 2)) << endl;
	cout << setw(25) << left << "Monthly Interest Rate:" << setw(10) << right << (to_string_precision(rateMonthly, 2) + "%") << endl;
	cout << endl;
	cout << setw(25) << left << "Loan amount:" << "$ " << amount << endl;
	cout << setw(25) << left << "Monthly Interest Rate:" << rateMonthly << "%" << endl;
	return 0;
}