speedConvert method

String speedConvert(
  1. double volume
)

The function speedConvert converts a double value to a string with two decimal places and appends "x" at the end.

Args: volume (double): The volume parameter is a double value representing the speed that needs to be converted.

Returns: a string representation of the input volume, rounded to 2 decimal places, followed by the letter 'x'.

Implementation

String speedConvert(double volume) {
  String value = volume.toStringAsPrecision(2);
  return '$value x';
}