Hi Marziya ,
Valueof() is a predefined function of Decimal Class which converts the value into decimal .
for example :-
-valueOf(doubleToDecimal)
Returns a Decimal that contains the value of the specified Double.
-valueOf(longToDecimal)
Returns a Decimal that contains the value of the specified Long.
-valueOf(stringToDecimal)
Returns a Decimal that contains the value of the specified String. As in Java, the string is interpreted as representing a signed Decimal.