Convert a double list to a grouped string
Disclaimer: Edit
OP later specified that the numbers must be grouped only if they are adjacent. My code does not do that. It groups all equal elements. Please refer to @Xiaoy312's answer for that. I have my own solution, but as that is not a significant improvement over @Xiaoy312's I'm not posting it. To me, @Xiaoy312's answer is overkill for the specific use case the OP mentions, it promotes good programming practices and code reusability.
Old answer
What you're trying to achieve here is similar to Run-Length Encoding, a basic data compression technique.
Off the bat, I'll make a few observations:

You are repeatedly concatenating immutable strings. Usually not a great idea, as it involves large overheads in creating and discarding a whole lot of string objects. Use StringBuilder in the System.Text namespace instead, and append to it instead of doing repeated string concatenation.

Too much code in one function. Split it up! An obvious candidate is the part which counts the number of occurrences of a value in the list. Try to follow separation of concerns and the Single Responsibility Principle.

You do redundant counting for values. For a particular value, you should cache its count and not repeat the count for the same value again (memoization).

Try LINQ. It might even make this code into a one-liner. And be more idiomatic at the same time, if a bit slower.

You could do this better by doing the logic in 2 passes - in the first, you construct a map between the unique values in the list and their count, and in the second, you use this map to generate the string representation.

Ideally for comparing 2 doubles for equality, keeping in mind their error margins and inexact representation of certain values, you would check that the modulus of the difference of the 2 values was less than some small epsilon. However, for code like this, that's probably overkill.

Try to program as generic as possible. Use an IEnumerable&lt;T&gt; instead of a very specific List&lt;double&gt;, you will be able to use the resulting code for many different types of collections. This also involves typing to interfaces instead of concrete classes.


Using most of the above suggestions, herein follows the code (test fiddle here):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class RLEofList
{
    
    private static Dictionary&lt;double, int&gt; CountMap(List&lt;double&gt; input)
    {
        var countMap = new Dictionary&lt;double, int&gt;(input.Count);
        foreach(double item in input)
        {
            if(!countMap.ContainsKey(item))
            {
                countMap.Add(item, input.Count(x =&gt; x == item));
            }
        }
        return countMap;
    }

    public static string ListToRLEString(List&lt;double&gt; input)
    {
        var countMap = CountMap(input);
        var accumulator = new StringBuilder(input.Count);//rough guess for capacity of StringBuilder
        foreach(KeyValuePair&lt;double, int&gt; itemWithCount in countMap)
        {
            if(itemWithCount.Value &gt; 1)
            {
                accumulator
                .Append(itemWithCount.Value)
                .Append(&quot;*&quot;);
            }
            accumulator
            .Append(itemWithCount.Key)
            .Append(&quot; &quot;);
        }
        return accumulator.ToString();
    }
    
    public static void Main()
    {
        var list = Console
            .ReadLine()
            .Split(',')
            .ToList()
            .ConvertAll&lt;double&gt;(x =&gt; Double.Parse(x));
        Console.WriteLine(ListToRLEString(list));
    }
}

The piece of code above will accept input as a single line of comma-separated numbers as per the example in the question. You might need to use Regex.Split for more complicated input patterns.
I'm not collapsing this code into a LINQ one-liner as I feel this is more educational.