Flex Pasta » Flex 4.5: Currency Formatter Changes

Flex 4.5: Currency Formatter Changes

In Flex 3, <mx:CurrencyFormatter /> will format a number 4500 out of the box as $4,500.00.  The precision property controls how many trailing decimals, so <mx:CurrencyFormatter precision=”0″/> will do 4500 as $4,500.

In Flex 4.5/Spark, <s:CurrencyFormatter/> will format a number 4500 out of the box as USD4500.  Not really what I had in mind for a US only application.  Certainly a valid improvement for international currency formatting.  But to achieve the same result as what we had in Flex 3,  do something like this:

<s:CurrencyFormatter currencySymbol=”$” useCurrencySymbol=”true” fractionalDigits=”0” trailingZeros=”false“/>

=$4,500

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>