private static Bruch ParseBruch(Match match) { var nenner = double.Parse(match.Groups["Nenner"].Value); var zähler = double.Parse(match.Groups["Zähler"].Value); return(Bruch.Parse(zähler, nenner)); }
private static Bruch ParsePeriode(Match match) { var vorKomma = match.Groups["VorKomma"].Value; var nachKomma = match.Groups["NachKomma"].Value; var periode = match.Groups["Periode"].Value; if (!string.IsNullOrEmpty(periode)) { return(Bruch.Parse(vorKomma, nachKomma, periode)); } return(string.IsNullOrEmpty(periode) && !string.IsNullOrEmpty(nachKomma) ? Bruch.Parse(vorKomma, nachKomma) : Bruch.Parse(vorKomma)); }