super_measurement 1.0.7
super_measurement: ^1.0.7 copied to clipboard
Dart package for converting unit measurement
Dart package for converting unit measurement #
Available Unit #
AngularSpeed #
DegreePerDayDegreePerHourDegreePerMinuteDegreePerSecondRadianPerDayRadianPerHourRadianPerMinuteRadianPerSecondRevolutionPerDayRevolutionPerHourRevolutionPerMinuteRevolutionPerSecond
Area #
AcresHectaresSquareCentimetersSquareFootSquareInchesSquareKilometersSquareMetersSquareMilesSquareYards
DataStorage #
BitByteGigabitGigabyteKilobitKilobyteMegabitMegabyteTerabitTerabyte
DataTransfer #
GigabitPerSecondGigabytePerSecondKilobitPerSecondKilobytePerSecondMegabitPerSecondMegabytePerSecond
Energy #
CalorieInternationalCalorieNutritionalCalorieThermochemicalElectronVoltGigaJouleJouleKiloJouleKilowattHourMegaJouleMegawattHourWattHour
Length #
CentimetersFeetFurlongsInchesKilometersMetersMilesMillemetersNauticalMilesYards
Mass #
CaratsGramsKilogramsMilligramsOuncesPoundsQuintalStoneUKTonUKTonUSTonne
Power #
HorsepowerKilowattMegawattMilliwattWatt
Pressure #
BarInchesOfMercuryMillimeterOfMercuryPascalPoundsPerSquareInchStandardAtmosphereTorr
Speed #
FootPerHourFootPerMinuteFootPerSecondKilometerPerHourKnotLightMeterPerHourMeterPerMinuteMeterPerSecondMilesPerHourMilesPerMinuteYardPerMinute
Time #
DayHourMillisecondMinuteSecondWeekYear
Volume #
BarrelsImperialBarrelsUSCubicCentimetersCubicFootCubicInchesCubicMetersCubicYardsGallonsImperialGallonsUSLitersMilliliters
Because the nature of this package, some raw conversion does not resulting in same value, for example:
void main(){
print([Feet(1), Inches(12)].toInches); // 24.00000000006096
print([Feet(1), Inches(12)].toInches.withPrecision()); // 24
print([Feet(1), Inches(12)].toFeet); // 1.9999999999949203
print([Feet(1), Inches(12)].toFeet.withPrecision()); // 2
print(Inches(12).toFeet); // 0.9999999999949201
print(Inches(12).toFeet.withPrecision()); // 1
print(Inches(12).toInches); // 12
print(Inches(12).toInches.withPrecision()); // 12
print(Feet(1).toFeet); // 1
print(Feet(1).toFeet.withPrecision()); // 1
print(Feet(1).toInches); // 12.000000000060961
print(Feet(1).toInches.withPrecision()); // 12
}
Use withPrecision() for more precision