unicodeExponent function

String unicodeExponent(
  1. num exp
)

Returns the unicode symbols that represent an exponent.

Implementation

String unicodeExponent(num exp) {
  final neg = exp < 0 ? '\u{207b}' : '';
  final absExp = exp.abs();
  final expStr = absExp.toString();
  final buf = StringBuffer()..write(neg);
  for (var place = 0; place < expStr.length; place++) {
    buf.write(expUnicodeMap[expStr[place]]);
  }

  return buf.toString();
}