define value with range(minimum,maximum)

hi , How can i define a value with range of minimum and maximum
for example
i am going to make a healthbar and there is a float maxHP and float currentHP
and i want to make a public int HpPercentage wich have minimum of 0 and maximum of 100 this is what i am looking for , i know i can do it in another ways
but i wanna know if there is a way to define value with range at frist

Public Int HpPercentage(range(0,100));

And again i found answer right after posting it .

[Range(0,100)] Public int HpPercentage;