Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigDecimal;
- import java.math.RoundingMode;
- public class CurrencyFormat {
- public static String getCustomCurrency(double currency) {
- BigDecimal cc = new BigDecimal(currency);
- return cc.setScale(2, RoundingMode.HALF_UP).toString();
- }
- }
Add Comment
Please, Sign In to add comment