formatCurrency() does not follow international standard for currency decimal, published here : https://www.currency-iso.org/en/home/tables/table-a1.html.
To define decimal I found that we need to use format() function after setting some NumberFormat attributes.
For example "COP" (Colombian peso) if defined to use 2 decimals, but NumberFormat::formatCurrency() use 0 decimal for this currency (I do not know why!).
Here is the code I use :
$fmt = new \NumberFormatter( 'fr', \NumberFormatter::CURRENCY);
$fmt->setTextAttribute( $fmt::CURRENCY_CODE, 'COP' );
$fmt->setAttribute( $fmt::FRACTION_DIGITS, 2 );
$numberString = $fmt->format( 1234.56 );
The output is: 1 234,56 $CO
If locale change to 'en' then the output is : COP1,234.56