Git Product home page Git Product logo

bigdecimal.js's People

Contributors

ahansen1 avatar jhs avatar thatguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bigdecimal.js's Issues

Unable to build

When trying to build this as per the readme's instructions, I get:

mscdex@server:~/iriscouch-bigdecimal.js-5ee98b5$ rake
RoundingMode.java.erb => RoundingMode.java
MathContext.java.erb => MathContext.java
BigInteger.java.erb => BigInteger.java
rake aborted!
compile error
(erb):38: syntax error, unexpected ')'
    ).to_s); _erbout.concat "\n    ...
     ^

Tasks: TOP => default => bigdecimal => /home/mscdex/iriscouch-bigdecimal.js-5ee98b5/lib/bigdecimal.js => /home/mscdex/iriscouch-bigdecimal.js-5ee98b5/build/out.js => /home/mscdex/iriscouch-bigdecimal.js-5ee98b5/BigDecimalApp/src/com/iriscouch/gwtapp/client/BigDecimal.java
(See full trace by running task with --trace)

Any ideas?

BigInteger magnitude constructor

Hi,
Is it possible to use the magnitude constructor from the Java BigInteger?

BigInteger(int signum, byte[] magnitude) 

I got errors about "function with number array arguments" not existing.

Trailing zero / compareTo bug?

Hi, using both nodejs and in the browser (firefox and chrome), I'm not getting the expected result for compareTo of 'equal' values, one with trailing zeros.

I thought compareTo ignored scale? Maybe I'm missing something though?

For now I'm adding .stripTrailingZeros() for each side of compareTo calls as a workaround.

Example:

var BD = require("bigdecimal");
var a=BD.BigDecimal('0.09');
var b=a.setScale(4);
console.log(a.compareTo(b)); // returns 1 (expected 0)
var a=BD.BigDecimal('0.091');
var b=BD.BigDecimal('0.0910000');
console.log(a.compareTo(b)); // returns 1 (expected 0)

how do i set a math context?

it's from java.math, but i need to use it in the bigdecimal class.

var currencyContext = new bigdecimal.MathContext(2)
TypeError: Object 2 has no method 'gC'

Issues when adding custom methods to Array.Prototype with bigdecimal.js

I'm seeing any issues when I add custom functions to Array.prototype while using the BigDecimal.js library.

Specifically it fails with a traceback to line 295:

function mb(b){return function(){try{return nb(b,this,arguments)}catch(a){throw a}}}

with this exception:
Uncaught java.lang.RuntimeException: Unknown call signature for obj = new java.math.BigDecimal: string function

I've tried multiple function names and it doesn't appear to be a naming collision, it just seems to be checking the methods on Array.prototype and failing for some reason if there are nonstandard methods.

Rounding issue with ROUND_HALF_UP

Based on the Java documentation, my expectation is that these two lines would result in the same value:

new BigDecimal(0.615000001).setScale(2, BigDecimal.ROUND_HALF_UP).toString() // => "0.62"
new BigDecimal(0.615).setScale(2, BigDecimal.ROUND_HALF_UP).toString() // => "0.61"

Operations on BigInt and BigDec?

Can we combine ints and decs in calculations?

for example, the following.

var a = b.BigDecimal('123456.123456789012345678901234567890');
var b = b.BigInteger(123456123456789012345678901234567890);

var result = a.multiply(b);

Is that allowed?
Can you add instructions for browser usage?

Error in prod build of Angular 6

If you make a prod build of Angular 6 you will see such error
vendor.1248eb8e9cd17359ec51.js:1 ERROR et {f: "Unknown call signature for obj = new java.math.BigDecimal: object"}
In dev build - all is ok
How can I resolve it ?

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.