I want the input for the price in decimal format(15.00). If the input is in integer format then I want to convert it to decimal format.

The maximum price for a sale is 999.99 and minimum is 0.00.

I have tried so far:

Code:
#include<iostream>
using std::cout;
using std::cin;

void main(){
    float eventPrice;

    bool cPrice = true;
    while (cPrice)
    {
        cout << "Please enter the event ticket price:";
        cin >> eventPrice;
        if (eventPrice <= 999.99 && eventPrice>=0) cPrice = false;
        else
        {
            cout << "Invlaid price. Try again!!";
        }
    }
    cout << "the price is:";
        cout << eventPrice;
}
Avalid input will be:

1.8,
0.8,
0.00,
0,
9,
99