toLiterPerMeter method

num toLiterPerMeter(
  1. VolumePerLengthUnit unit
)

convert num from unit to liters per meters

Implementation

num toLiterPerMeter(VolumePerLengthUnit unit) {
  switch (unit) {
    case VolumePerLengthUnit.usGallonPerMile:
      return toLiter(VolumeUnit.usLiquidGallon).toMile;
    case VolumePerLengthUnit.imperialGallonPerMile:
      return toLiter(VolumeUnit.imperialGallons).toMile;
    case VolumePerLengthUnit.literPer100Kilometer:
      return (this / 100).toKilometer;
    case VolumePerLengthUnit.literPerKilometer:
      return toKilometer;
    default:
      return this;
  }
}