Ejemplo n.º 1
0
 public override double operate(string number)
 {
     try
     {
         string s = "";
         s = number.Substring(((number.IndexOf('x') + 1)), (number.Length - (number.IndexOf('x') - 2)));
         s = (double.Parse(s, CultureInfo.InvariantCulture.NumberFormat) / 100).ToString();
         s = s.Replace(',', '.');
         double temp = double.Parse(s, CultureInfo.InvariantCulture.NumberFormat);
         temp = getResult() * temp;
         this.setResult(operation.operate(Convert.ToString(temp)));
         return(this.getResult());
     }
     catch (CalculatorException e)
     {
         throw;
     }
     catch (Exception e)
     {
         throw;
     }
 }