That seems like a bug, the reason it’s pulling the exponent is probably because of that hyphen after the e, it parsed the number incorrectly as -4 and -12.  Not sure of the workaround without playing around and unfortunately I don’t have time at the moment.  Sorry, please file it if you can!

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Brueckmann
Sent: Wednesday, August 31, 2005 6:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] NumberFormatter question

 

Hey guys...I saw in the archive there was a long thread about decimals and the NumberFormatter but none of them really addressed what I'm encountering so I figured I'd throw this out there to see if anyone else has seen this behavior and if they're simply converting the number to a string as a workaround or if there is something valid I can do to handle this situation:

 

I'm getting XML from the database that contains a whole slew of calculations.  We're parsing the XML and populating a datagrid with this data and on the cells showing the numbers I have a custom cell renderer that simply uses a NumberFormatter to ensure negative numbers are represented with parentheses and all numbers are rounded to a precision of 3 decimal places as well as some additional logic to ensure negative numbers are colored red.  Well, when we get small numbers and ActionScript internally represents them in exponential format, for example, 9.6345e-4...oddly, the number being displayed in the datagrid is (4.000)  Another number being returned is 3.3123e-12 and what's being shown in the datagrid is (12.000).

 

Why the heck is the number formatter ignoring the actual number and simply applying the formatter to the exponent value?!  I would expect for both of these numbers, the resulting value would simply be .000, no?

 

Any help is greatly appreciated.

 

Thanks,

 

robert l. brueckmann

senior web developer

merlin securities

595 madison avenue

new york, ny 10022

p: 212.822.4821

f: 212.822.4820

 


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.




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Software design and development Macromedia flex
Software development best practice


YAHOO! GROUPS LINKS




Reply via email to