Example #1
0
        public static string EquationResultToString(VariableCollection[] result, string resultVariable = "x")
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < result.Length; i++)
            {
                sb.AppendLine($"{ resultVariable }{ ToStringHelper.IntToSubscript(i + 1) } = { result[i].ToString(true) }");
            }
            return(sb.ToString());
        }
 public string ToString(bool useUnicodeCharacters)
 {
     if (Exponent != 1)
     {
         if (!useUnicodeCharacters)
         {
             return(Marker + "^" + Exponent.ToString().Replace(',', '.'));
         }
         else
         {
             if ((Exponent % 1) == 0)
             {
                 return(Marker + ToStringHelper.IntToSuperscript((int)Exponent));
             }
             else
             {
                 return("(" + Marker + "^" + Exponent.ToString().Replace(',', '.') + ")");
             }
         }
     }
     return(Marker.ToString());
 }