GithubHelp home page GithubHelp logo

luoyelusheng / number_precision Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 74 KB

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

License: MIT License

Java 7.57% Ruby 10.32% Objective-C 7.46% Dart 74.65%

number_precision's Introduction

Hi there 👋

number_precision's People

Contributors

luoyelusheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yjihdn0633

number_precision's Issues

四舍五入方法异常

print(NP.round(0.665, 2)); // 0.67 对的
print(NP.round(12.665, 2)); // 12.67 对的
print(NP.round(2461.5384615384614, 6)); // 错的 0.742802

beyond boundary when transfer to integer

I run into this issue frequently but can resolve it by using the 'strip' function to reduce the character length of a "run-away decimal", however it also happens in the package where I can't change anything. In this example the times function used by the divide function will give the error.

Perhaps use BigInts rather, or strip decimals to fall into the Int range?

Great package btw, I prefer using this over the Decimal package, also algins with the npm package.

This is on number_precision: ^2.0.2+1

image

截取异常

print(NP.strip('0.665', precision: 2)); // 0.67 对的
print(NP.strip('12.665', precision: 2)); // 12.66 错的,为什么不是 12.67

print(NP.round(0.665, 2)); // 0.67 对的
print(NP.round(12.665,2));// 12.67 对的

number_precision: 2.0.1+1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.