encode static method

String encode(
  1. Rational value
)

Encodes a Rational to its canonical string representation.

Uses Rational.toString which produces fraction format (e.g., "3/4"). This is the format that should be used for persistence (JSON, SQLite, etc.).

Implementation

static String encode(Rational value) => value.toString();