decimal 0.1.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 89

Dart Decimals

Build Status

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(Decimal.parse('0.2') + Decimal.parse('0.1')); // displays 0.3

Usage

To use this library in your code :

  • add a dependency in your pubspec.yaml :
dependencies:
  decimal: ^0.1.3
  • add import in your dart code :
import 'package:decimal/decimal.dart';
  • Start computing using Decimal.parse('1.23').

Hint : To make your code shorter you can define a shortcut for Decimal.parse :

final d = Decimal.parse;
d('0.2') + d('0.1'); // => 0.3

License

Apache 2.0

v0.1.4 (2017-06-16)

  • make package strong clean

v0.1.3 (2014-10-29)

  • add Decimal.signum
  • add Decimal.hasFinitePrecision
  • add Decimal.precision
  • add Decimal.scale

Semantic Version Conventions

http://semver.org/

  • Stable: All even numbered minor versions are considered API stable: i.e.: v1.0.x, v1.2.x, and so on.
  • Development: All odd numbered minor versions are considered API unstable: i.e.: v0.9.x, v1.1.x, and so on.

1. Depend on it

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


dependencies:
  decimal: "^0.1.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:decimal/decimal.dart';
        
Version Uploaded Documentation Archive
0.1.4 Jun 16, 2017 Go to the documentation of decimal 0.1.4 Download decimal 0.1.4 archive
0.1.3 Oct 29, 2014 Go to the documentation of decimal 0.1.3 Download decimal 0.1.3 archive
0.1.2 Jul 25, 2014 Go to the documentation of decimal 0.1.2 Download decimal 0.1.2 archive
0.1.1 Nov 28, 2013 Go to the documentation of decimal 0.1.1 Download decimal 0.1.1 archive
0.1.0 Nov 20, 2013 Go to the documentation of decimal 0.1.0 Download decimal 0.1.0 archive
0.0.5 Nov 9, 2013 Go to the documentation of decimal 0.0.5 Download decimal 0.0.5 archive
0.0.4 Apr 17, 2013 Go to the documentation of decimal 0.0.4 Download decimal 0.0.4 archive
0.0.3 Jan 23, 2013 Go to the documentation of decimal 0.0.3 Download decimal 0.0.3 archive
0.0.2 Jan 22, 2013 Go to the documentation of decimal 0.0.2 Download decimal 0.0.2 archive
0.0.1 Jan 20, 2013 Go to the documentation of decimal 0.0.1 Download decimal 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
79
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
99
Overall score:
Weighted score of the above. [more]
89

Platforms

Detected platforms: Flutter, server, web

All libraries agree

Dependencies

Package Constraint Resolved Available
Direct dependencies
rational ^0.1.11 0.1.11
Dev dependencies
test ^0.12.0