I want to take float input from user with only two decimal point(999.99) and convert it into string
float amount;
cout << "Please enter the amount:";
cin.ignore();
cin >> amount;
string Price = std::to_string(amount);
my output for this code is 999.989990
cin.ignore();, it's completely unclear, why you want it to use here. Also you note not all exact decimals can be represented by afloatordoublevalue.std::cout << Price << std::endl;