Converting Generic value to Decimal value




i am trying to convert a value 5.32 (Generic) and 5.37.6309( Generic) to decimal values so that i can compare them in if condition. i have saved frst value in pattern and second value in pattern1 and i am using if (DBcl(pattern.ToString) > DBcl(pattern1.ToString)) but this is not working and giving an error saying cannot convert.


This might work in your case

Version.Parse(pattern) > Version.Parse(pattern1)