Popa Mihai

PopaMihai.com – Flex, Flash, AIR and ActionScript articles and tutorials

Archive for the ‘Formatters’ tag

Example of Using the ZipCodeFormatter Class in Flex

2 comments

The ZipCodeFormatter is another built-in Flex Formatter. The ZipCodeFormatter can take only one parameter and you can use that parameter to format the zip code in one of the following formats:
Read the rest of this entry »

Written by Popa Mihai

July 28th, 2009 at 3:52 pm

Posted in Flex

Tagged with , ,

Example of Using the PhoneFormatter Class in Flex

one comment

The PhoneFormatter is another built-in flex formatter. With this formatter you can format a number into different phone number formats. The syntax for the PhoneFormatter:
Read the rest of this entry »

Written by Popa Mihai

July 28th, 2009 at 3:17 pm

Posted in Flex

Tagged with , ,

Example of Using the NumberFormatter Class in Flex

2 comments

The NumberFormatter is another built-in formatter that is very similar to the CurrencyFormatter. The syntax for the NumberFormatter:
Read the rest of this entry »

Written by Popa Mihai

July 28th, 2009 at 2:40 pm

Posted in Flex

Tagged with , ,

Example of Using the DateFormatter Class in Flex

3 comments

The DateFormatter is a very simple formatter. To use it you just have to specify the formatString property, apply the format and you are done.

<mx:DateFormatter formatString="Y|M|D|A|E|H|J|K|L|N|S"/>

Here are some short explanations of what the characters in formatString represent:
Read the rest of this entry »

Written by Popa Mihai

July 28th, 2009 at 1:54 pm

Posted in Flex

Tagged with , ,

Example of Using the CurrencyFormatter Class in Flex

2 comments

The CurrencyFormatter class formats a number as a currency value. When using the CurrencyFormatter in Flex you can specify the currency symbol, you can align the currency symbol the right or to the left of the amount, you can use a negative sign or not etc:
Read the rest of this entry »

Written by Popa Mihai

July 27th, 2009 at 9:35 pm

Posted in Flex

Tagged with , ,

Flex Formatters

leave a comment

Flex Formatters are Flex components that are used to format data into strings. Adobe Flex come with a number of built in formatters: the currency formatter, the date formatter, the number formatter, the phone number formatter, and the ZIP code formatter.

All the built in formatters are subclasses of the Formatter class (mx.formatters.Formatter).  To trigger the formatter you will use the format() method that takes a value as a parameter and returns the formatter string.
Read the rest of this entry »

Written by Popa Mihai

July 27th, 2009 at 8:44 pm

Posted in Flex

Tagged with , ,