Solved

How to format a textfield with currency formatter in Flex?

Posted on 2011-03-06
2
905 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

790 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