I try my best.
First of all, yours string num = 23.6;will not even compile. You need to use double quotes with your strings likestring num = "23.6";
If you want to get this as decimal, you first need to analyze it with a help IFormatProviderthat .has NumberDecimalSeparatorhow InvariantCulture(if your CurrentCultureuses .already, you don't need to pass a second parameter);
decimal nn = decimal.Parse(num, CultureInfo.InvariantCulture);
23.6 decimal. 23.6, 23.60, 23.600 23.60000000000 , ? , , , 23.6M . , . . " " .NET.
? , 23.600. , "F" Format Specifier .
string str = nn.ToString("F3", CultureInfo.InvariantCulture);