Solution:
An easy fix would either be casting it to a decimal (Note that price has to be a decimal in that case):
return price = price - (decimal)10/100*price;
or use a decimal as the divisor:
return price = price - 10M/100M*price;
you obviously have to adjust your return type as well:
public decimal SetDiscountPrice(){
return price = price - (decimal)10/100*price;
}
Important Information:
Maybe you should actually overthink your attempt a little bit. A method starting with "Set" sounds like it should be a property and I think it's definitely possible in your case. And are you sure you want your setter-method to change your value and return it at the same time? Maybe following could help you:
class YourClass{
public decimal Price {get; set;}
public decimal DiscountPrice => (decimal)10/100*Price;
}