Du gibst in der Funktion ein RETURNS DECIMAL an, obwohl Du ein CHAR zurückgibst.

Gruß,
KM