Hi, I have the formular
mkm=((((amountdrug/fluidvol)*1000)/60)*infrate)/ptwt;
in my java code. The code works fine but returns to several decimal places. How do I limit to 2 or 3? Also can anyone recomend a book that teaches basic Android/java? Thanks
Edit 04/09/10 Thanks to everyone who took the time to try to help with this problem. Thanks to KennyTM who’s comment led me to the answer –
double mkm = ((((amountdrug/fluidvol)*1000f)/60f)*infrate)/ptwt;
int precision = 100; //keep 2 digits
mkm = Math.floor(mkm * precision +.5)/precision;
Sorted! Thanks again to all.