<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def convert_param_to_dirname(param):
 """ Helper function to convert a parameter value to a valid directory name. """

    if type(param) == types.StringType:
        return param
    else:
        return re.sub("0+$", '0', '%f'%param)