formatSpeed static method
//////////// //////////// Formats a speed value (in km/h) based on the desired unit system
Implementation
// II.B - Speed Formatting
///////////////
/// Formats a speed value (in km/h) based on the desired unit system
static String formatSpeed(double speedKmh, {bool useImperialUnits = false}) {
if (useImperialUnits) {
final speedMph = speedKmh * 0.621371;
return '${speedMph.round()} mph';
} else {
return '${speedKmh.round()} km/h';
}
}