number_precision 2.0.2+1 copy "number_precision: ^2.0.2+1" to clipboard
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)}'),
            ],
          ),
        ),
      ),
    );
  }
}
7
likes
160
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on number_precision