Your example works fine as long as “totalAmt” is a number, formatting will work as expected.

My problem has a different context, though:

I have 2 text inputs, both of them are being formatted using the regular NumberFormatted. I’m trying to get the numbers out of the 2 text boxes, add them up and format the result. The form is a regular data entry screen; I’m retrieving the text input as textInput.text which gives me back the formatted number. So in order to get back a number I use parseFloat(formattedString).

If the number is 0.00004 (more than 5 decimals), I get back 4e-5, in scientific notation.  I’d like to be able to get back 0.00004 and to format it properly.

 

Thanks.



Robert Brueckmann <[EMAIL PROTECTED]> wrote:

Valy…in your MXML file, create a NumberFormatter component like this (setting the precision to what you need):

 

<mx:NumberFormatter id="numberformatter" precision="8" useThousandsSeparator="true" useNegativeSign="true"/>

 

And then on the field that displays your total…if it’s a label or something, do this:

 

<mx:Label id=”total” text=”{numberformatter.format(totaAmt)}” />

 

Or something to that affect…

 

Robert L. Brueckmann

Web Developer

Merlin Securities, LLC

595 Madison Avenue

New York, NY 10022

p: 212.822.4821
f: 212.822.4820


From: Valy Sivec [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 02, 2005 10:24 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Number Format issue. I need help.

 

I spent some time without figuring out a way to format
a number in double precision.

I have a grid and below it a total field that should
sum the grid colums.  When I enter in the grid columns
values as 0.00000008, 0.00000001 the result field
displays 9e-8, which is correct but I would like to
display it as 0.00000009 instead.... Any suggestions?

Thanks,
Valy


--- Valy Sivec <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I have some some number formatted form elements that
> I
> need to sum up. In order to do that, I use
> parseFloat
> to extract the number out of the formatted string
> input. When the number has more than 5 decimals,
> let's
> say "0.0000008", the get back the trailing
> exponents:
> 8e-7.
>
> Is there a way to get back the number without the
> trailing exponents (0.0000008)?
>
>
> TIA,
> Val.
>
>
>
>
>      
>            
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospe! ctive: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>



     
           
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/


 

This message contains information from Merlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.
Merlin Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.


Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web

Reply via email to