So I have this database that can have either a double, string, or int, and I need to cast that value to an int so it can be sorted by value.
Example:
dynamic input1 = "1";
dynamic input2 = 3;
dynamic input3 = "4.02";
dynamic input4 = 2.3;
// [1, 3, 4, 2]
List<int> output = [toInt(input1), toInt(input2), toInt(input3), toInt(input4)];
output.sort(); // [1, 2, 3, 4]