Skip to content

yeradis/units.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2212042 · Feb 10, 2018

History

25 Commits
Oct 12, 2017
Oct 15, 2017
Oct 15, 2017
Oct 13, 2017
Oct 21, 2017
Oct 14, 2017
Feb 10, 2018
Oct 12, 2017
Oct 15, 2017
Oct 12, 2017
Oct 15, 2017
Feb 10, 2018
Oct 14, 2017
Oct 14, 2017

Repository files navigation

Units Pub Travis status Coverage Status

A starting point for measurement units in Dart.

Included right now:

  • Speed

    • Meter per second m/s
    • Kilometer per hour km/h
    • Mile per hour mi/h
    • Knot kn
  • Length

    • Meter m
    • Kilometer km
    • Mile mi
  • Angle

    • Degree °
    • Radian rad
    • Gradian grad

    Supports negative angles, not restricted to 360 degrees or 2PI radians

  • Temperature

    • Celsius °C
    • Fahrenheit °F
    • Kelvin K
    • Rankine °R
    • Romer °Rø

Usage

A simple usage example:

    import 'package:units/units.dart';

    main() {
        var speed = new Speed.fromKilometerPerHour(value: 360.0);
        print('360 km/h are ${speed.inMeterPerSecond} m/s');
        print('360 km/h are ${speed.inMeterPerSecond} mi/h');
    }

Note: All numbers are forced to a max representation with exactly 6 significant digits.

For example: 12345678910.12345678 will turn into: 12345678910.123457

About

A starting point for measurement units in Dart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published