Show cents only if price contains them
I know that you receive double, but you shouldn't get your system "infected" by double prices. This is just wrong. Convert them once you received them.

Instead of comparing your Doubles to find the Integer, you could also just work with the String and replace the zeros. This will also work with your double values and is a valid approach if you just want to render the number.

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

public class Main
{
    public static void main(String... args)
    {
        System.out.println(format(new BigDecimal("2.1111")));
        System.out.println(format(new BigDecimal("5454542.1111")));
        System.out.println(format(new BigDecimal("5454542.1")));
        System.out.println(format(new BigDecimal("5454542")));
    }

    private static String format(BigDecimal price)
    {
        return createFormat().format(price).replace(",00", "");
    }

    private static DecimalFormat createFormat()
    {
        DecimalFormatSymbols dfSymbols = new DecimalFormatSymbols();
        dfSymbols.setDecimalSeparator(',');
        dfSymbols.setGroupingSeparator(' ');
        final String currency = "$";
        dfSymbols.setCurrencySymbol(currency);
        return new DecimalFormat("###,###,##0.00 \u00A4", dfSymbols);
    }
}


This will give you:

2,11 $
5 454 542,11 $
5 454 542,10 $
5 454 542 $