number_precision 2.0.2+1 icon indicating copy to clipboard operation
number_precision: ^2.0.2+1 copied to clipboard

Perform addition, subtraction, multiplication and division operations precisely using dart

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:number_precision/number_precision.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('0.1 + 0.3 = ${NP.plus(0.1, 0.3)}'),
              Text('0.1 - 0.3 = ${NP.minus(0.1, 0.3)}'),
              Text('0.1 * 0.3 = ${NP.times(0.1, 0.3)}'),
              Text('0.1 / 0.3 = ${NP.round(NP.divide(0.1, 0.3), 2)}'),
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
140
pub points
79%
popularity

Publisher

unverified uploader

Perform addition, subtraction, multiplication and division operations precisely using dart

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on number_precision