using System.Collections.Generic;
public static void Main()
List<decimal> list = new() { 23.346m, 23.56m, 4.2m, 0.90000000000000000000000000000m, 0.59333800m };
List<decimal> sorted = new();
foreach (var value in list)
sorted.Add(Numerics.GetValueAfterDecimalSeparator(value));
sorted.OrderByDescending(x => x).ToList().ForEach(x => Console.WriteLine(x));
Console.WriteLine(sorted.OrderByDescending(x => x).FirstOrDefault());
public static int GetValueAfterDecimalSeparator(decimal sender)
static decimal Normalize(decimal value)
=> value / 1.000_000_000_000_000_000_000_000_000_000_000m;
decimal normalized = Normalize(sender);
int countDecimalNumbers = BitConverter.GetBytes(decimal.GetBits(normalized)[3])[2];
decimal leftValue = Math.Floor(normalized);
decimal rightValue = Math.Abs(leftValue - normalized);
int multiplier = (int)Math.Pow(10, countDecimalNumbers);
return decimal.ToInt32(decimal.Multiply(rightValue, multiplier));
catch (OverflowException)