Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to format a textfield with currency formatter in Flex?

Posted on 2011-03-06
2
Medium Priority
?
930 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

927 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