Cookies won't go down when buying upgrades

Hello, I am currently making this cookie clicker game just for fun. I got the clicking to work and the power of the click when you buy the upgrade, but there is one problem. The amount of cookies will not go down so I checked the script and forgot one thing to make it decrease.

I get an error like so:
Assets/UpgradeManager.cs(23,13): error CS0266: Cannot implicitly convert type float' to int’. An explicit conversion exists (are you missing a cast?)

Here is my script

using UnityEngine;

public class UpgradeManager : MonoBehaviour {

    public Click click;
    public UnityEngine.UI.Text itemInfo;
    public float cost;
    public int count = 0;
    public int clickPower;
    public string itemName;
    private float _newCost;

    void Update() {
        itemInfo.text = itemName + "\nCost: " + cost + "\nPower: +" + clickPower;

    }

    public void PurchasedUpgrade() {
        if (click.cookie >= cost) {
            click.cookie -= cost;
            count += 1;
            click.cookieperclick += clickPower;
            cost = Mathf.Round(cost * 1.15f);
            _newCost = Mathf.Pow(cost, _newCost = cost);
        }

    }


}

public float cost; makes click.cookie -= cost; wrong. If I change public float to an int it makes cost= Mathf.Round(cost*1.15f);

I am very confused on how and what to fix. Thank you for helping.

floats hold fractional values

ints hold whole values

use what meets your needs

I don’t know how to fix this cause I’m a rookie scripter. Could you please try your best to explain or help me fix this problem? Thank you

I don’t know what your expected behaviour is.

Do you need whole numbers, or do you need fractions?

It sounds like you might need fractions, in which case set BOTH to float.

Though really… you might want to use a datatype like double or decimal as they have a larger sig value range. And cookie-clickers usually need large sig value ranges.