Equivalent to bcdiv from php in java -


what equivalent of bcdiv(string, string [, int]) in java

the function divides 2 arbitrary precision numbers

i instance use:

bcdiv(10000,100, 2) results in 100.00

or

bcdiv(10000,100, 3) result in 100.000

i more interested in precision gives.

i equivalent in java

link php manual

the bigdecimal class allows arbritary precision math. in particular see divide method.

bigdecimal = new bigdecimal(10000);//can take int bigdecimal b = new bigdecimal("100");//or string bigdecimal answer = a.divide(b); 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -