private double ConvertResultToDesiredUnits(StorageUnit unit, double input) { return(unit switch { StorageUnit.Kilobyte => SystemConverter.BytesToKilobytes(input), StorageUnit.Megabyte => SystemConverter.BytesToMegabytes(input), StorageUnit.Gigabyte => SystemConverter.BytesToGigabytes(input), StorageUnit.Terabyte => SystemConverter.BytesToTerabytes(input), _ => input, });
private double ConvertToOptionsUnit(double bytes, StorageUnit unit) { return(unit switch { StorageUnit.Kilobyte => SystemConverter.BytesToKilobytes(bytes), StorageUnit.Megabyte => SystemConverter.BytesToMegabytes(bytes), StorageUnit.Gigabyte => SystemConverter.BytesToGigabytes(bytes), StorageUnit.Terabyte => SystemConverter.BytesToTerabytes(bytes), _ => bytes, });