PHP NumberFormatter: No Decimal/Fraction Digits Unless Necessary

I'm trying to get the PHP NumberFormatter class to output currencies like:

  • $2
  • $2.99
  • $2.50

This mostly works:

$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
$formatter->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 0);
return $formatter->formatCurrency($price, 'USD');

Except for in the case of $2.50, it actually outputs $2.5 (missing the trailing zero).

Is there some attribute configuration that will give me what I'm expecting?