decimal 0.1.1

Dart Decimals

This project enable to make computations on decimal numbers without loosing precision like double operations.

For instance :

// with double
print(0.2 + 0.1); // displays 0.30000000000000004

// with decimal
print(dec('0.2') + dec('0.1')); // displays 0.3

Usage

To use this library in your code : * add a dependency in your pubspec.yaml :

dependencies:
  decimal: '<1.0.0'
  • add import in your dart code :
import 'package:decimal/decimal.dart';
  • Start computing using dec('1.23').

License

Apache 2.0

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  decimal: ">=0.1.1 <0.2.0"

If your package is an application package you should use any as the version constraint.

2. Install it

If you're using the Dart Editor, choose:

Menu > Tools > Pub Install

Or if you want to install from the command line, run:

$ pub install

3. Import it

Now in your Dart code, you can use:

import 'package:decimal/decimal.dart';
Version Uploaded Archive
0.1.1 Nov 28, 2013 Download decimal 0.1.1 archive
0.1.0 Nov 20, 2013 Download decimal 0.1.0 archive
0.0.5 Nov 09, 2013 Download decimal 0.0.5 archive
0.0.4 Apr 17, 2013 Download decimal 0.0.4 archive
0.0.3 Jan 23, 2013 Download decimal 0.0.3 archive
0.0.2 Jan 22, 2013 Download decimal 0.0.2 archive
0.0.1 Jan 20, 2013 Download decimal 0.0.1 archive

About

A simple package to deal with decimal numbers

Author

Email alexandre.ardhuin@gmail.com Alexandre Ardhuin

Homepage

https://github.com/a14n/dart-decimal

Uploader

alexandre.ardhuin

Share