Using NumberFormatter !

This class is used to format the number in a way we like, like the number 2000 to 2,000 or 2000 to 2,00.00 or 2000.2345 to 2,000.23 like that.So the usage is given below, its like the beautification to the data.

Code Example:

<mx:NumberFormattter id=”nftr” precision=”2″ />

Now in a the Script block u can use this to format the number.As

nftr.format(2000.123456);

This will format to 2,000.12.

There are still many properties in the NumberFormatter class to use like thousandSeperatorfrom,thousandSeperatorto …… like so, can explore these very simple.

As i said it addds beautification to the data in the Application.

Enjoy the post.Can leave a comment for queries.

Leave a Reply