Solved

How to format a textfield with currency formatter in Flex?

Posted on 2011-03-06
2
908 Views
Last Modified: 2012-05-11
Hello,

i know how i can format a cell in a datagrid with a currency formatter. But i don´t know how to format a textfield.

e.g. the output of the textfield is 768212 and it has to be $ 768.212

Thank you!
0
Comment
Question by:druplash
2 Comments
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 35054697
This is how I use it in one of my applications (Ok it's a DateFormatter, but it's actually usable the same way the CurrencyFormatte is used:
<fx:Declarations>
    <mx:DateFormatter id="dt"
                          formatString="{ResourceManager.getInstance().getString('formatting', 'DATE_FORMAT')}" />
</fx:Declarations>

...

<s:Label text="{dt.format(hostComponent.hiObject.validToDate)}" toolTip="{hostComponent.hiObject.validToDate}" alpha.disabled="0.5"/>

Open in new window


I thiAnother site using a different approach woud be this:
http://blog.flexexamples.com/2007/08/25/using-the-currencyvalidator-and-currencyformatter-classes-to-validate-and-format-numbers/

0
 

Author Closing Comment

by:druplash
ID: 35072122
Thank´s! Great work!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question