yeradis / units.dart

A starting point for measurement units in Dart
MIT License
13 stars 5 forks source link

Units Pub Travis status Coverage Status

A starting point for measurement units in Dart.

Included right now:

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