formatSheenSpeed function Music

String formatSheenSpeed(
  1. double speed
)

A playback speed as a player shows it: 1×, 1.25×, 0.8×.

Implementation

String formatSheenSpeed(double speed) {
  var s = speed.toStringAsFixed(2);
  while (s.contains('.') && (s.endsWith('0') || s.endsWith('.'))) {
    s = s.substring(0, s.length - 1);
  }
  return '$s×';
}