I think you have to develop it because Java do nothave a predefine formula. My suggestion searchingbusiness books specially in the realm of accountingand financial.