convert_ms_to_percent function