I am not sure you know what str_to_num does. str_to_num works only if the given string contains a number like in "3.14". If you pass "3.14" to str_to_num it will return 3.14. In any case there is no number in the string str_to_num will return 0. If you took for example str_to_num("filename.mdl") the return value will always be 0. I assume you're trying to pass a filename back. That's why i wrote you should change "function" to "STRING*" and return the string without any conversion.