If I correctly understood your problem, then you need to perform certain operations with numbers that can represent parameters in different units of measurement. The only thing is not clear where and how your units of measurement are indicated, so for now weβll determine that some units of measurement are specified all the same initially but they need to be reduced to one factor, for example:
10ΠΌ. + 30ΡΠΌ. + 600ΠΌΠΌ. = 1ΠΌ. + 0,3ΠΌ. + 0,6ΠΌ. = 1,9ΠΌ.
In this case I would suggest an object approach, i.e. each number is a successor of an interface like this:
public interface INumInCI { /// <summary> /// Π·Π°Π΄Π°Π½Π½ΠΎΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ /// </summary> double Value { get; set; } /// <summary> /// ΡΠ΅ΠΊΡΡΠΈΠΉ ΠΌΠ½ΠΎΠΆΠΈΡΠ΅Π»Ρ /// </summary> double Factor { get; set; } /// <summary> /// Π‘ΠΏΠΈΡΠΎΠΊ ΠΌΠ½ΠΎΠΆΠΈΡΠ΅Π»Π΅ΠΉ, Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ Π΄Π»Ρ ΠΌΠ΅ΡΡΠΎΠ² /// 0.001, "ΠΌΠΌ." /// 0.01, "ΡΠΌ." /// 0.1, "Π΄ΠΌ." /// 1, "ΠΌ." /// 1000, "ΠΊΠΌ." /// </summary> Dictionary<double, string> FactorList { get; set; } /// <summary> /// Π²ΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ Ρ ΠΌΠ½ΠΎΠΆΠΈΡΠ΅Π»Π΅ΠΈ 1 /// Ρ ΡΡΠ΅ΡΠΎΠΌ ΡΠΎΠ³ΠΎ ΡΡΠΎ ΡΠ΅ΠΊΡΡΠ΅Π΅ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ ΠΈ ΡΠ΅ΠΊΡΡΠΈΠΉ ΠΌΠ½ΠΎΠΆΠΈΡΠ΅Π»Ρ ΠΈΠ·Π²Π΅ΡΠ½Ρ /// </summary> /// <returns></returns> double Get_CI_Value(); }
and to all this, it will be necessary to attach an editor to enter an expression indicating the entered values, or a good parser with checking the entered data, this is to your taste.