toFraction method

Fraction toFraction()

Converts the string into a Fraction.

If you want to be sure that this method doesn't throw a FractionException, use isFraction before.

Implementation

Fraction toFraction() {
  try {
    return Fraction.fromString(this);
  } on FractionException {
    return Fraction.fromGlyph(this);
  }
}