public ShutterSpeed(string shutterSpeed) { // Expected format is {numerator}/{denominator} string[] splitString = shutterSpeed.Split('/'); if (splitString.Length == 2) { URational urational = new URational(Convert.ToInt32(splitString[0]), Convert.ToInt32(splitString[1])); this.Seconds = urational.ToDouble(); } else { throw new ArgumentException("Shutterspeed was not of expected format:" + shutterSpeed); } }
public ShutterSpeed(URational urational) { // Use 6 decimal places this.Seconds = urational.ToDouble(6); }