in reply to convert letters into a number

You can use ord to return the numeric code associated with a (generally ASCII) character.

Perhaps unrelated to what you are actually asking, but there is a problem with your arithmetic. Also, have you considered that simply summing the 'letters' will not give unique codes?

What are you actually trying to achieve with this coding system? I suspect there is a better way to accomplish your objective than this convert and sum technique.

Update: OP reports "I intend to group planes which have similar names for example DAL13 and DAL14, I have already different criteria but I think that making the sum will help to have more discrimination.".


DWIM is Perl's answer to Gödel