MonoTouch.Dialog.Extensions.Fraction.ToDecimal C# (CSharp) Method

ToDecimal() public method

The function returns the current Fraction object as decimal
public ToDecimal ( ) : decimal
return decimal
		public decimal ToDecimal()
		{
			return ( (decimal)this.Numerator/this.Denominator );
		}
		

Usage Example

		public override void Selected(UIPickerView uipv, int row, int comp)
		{
			switch(comp)
			{
				case 0:
					int.TryParse(Inches[row], out selectedInches);
					break;
				
				case 1:
					selectedFraction = Fraction.ToFraction(Fractions[row]);
					break;
			}
			
			_RealValue = selectedInches + selectedFraction.ToDecimal();
			
		}