composeSymbol method

void composeSymbol(
  1. StringBuffer buffer,
  2. Symbol symbol
)

Implementation

void composeSymbol(StringBuffer buffer, Symbol symbol) {
  buffer.write('(');
  if (symbol.prefix != null) {
    buffer.write(symbol.prefix?.names.first);
  }
  buffer.write(symbol.unit?.names.first);
  if (symbol.exponent != 1) {
    buffer.write(' ^ ');
    buffer.write(symbol.exponent);
  }
  buffer.write(')');
}