Solved

How to format a textfield with currency formatter in Flex?

Posted on 2011-03-06
2
898 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
Comment Utility
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
Comment Utility
Thank´s! Great work!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Flash being Disabled - help! 20 331
Adobe Experience Manager 4 167
flash in chrome 4 65
HTML 5 video and audio or Flash 1 27
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…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now