wrong result in division operation of bignumber.js javascript library downloaded from jsfromhell?

StackOverflow https://stackoverflow.com/questions/22760044

  •  24-06-2023
  •  | 
  •  

سؤال

I am using bignumber.js(http://jsfromhell.com/classes/bignumber)

Following division operation giving me wrong result:

a=new BigNumber(100)
alert(a.divide(1))

gives the result 100.0981 instead of 100

Does anyone has encountered this problem? If anyone has solved it please help me to solve it also?

Thanks in advance...

هل كانت مفيدة؟

المحلول 2

I ended up using

alert(a/1)

as there is the bug in the divide function of bignumber.js

نصائح أخرى

The JS code you link to has a bug in it.

Given how cryptically it has been written, it's difficult to say exactly where the problem is, or how to fix it.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top