Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 08:33
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash 8 (Moderators: Jorge Solis, ..:: Mazhar Hasan ::.., Andresss)
| | |-+  Number formatting to set data field to 2 decimal places
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Number formatting to set data field to 2 decimal places  (Read 1035 times)
Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« on: 02/22/10, 00:48 »

The example in the help, doesn't work for me since I am calculating the field Total
myself, I'm not getting it from any data grid.
____________
var Total:DataType = dataGrid.getField("currentBalance");
Total.formatter.precision = 2;

__________

Is there another way to set how many decimal places gets used for an field?

Thank you
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 02/22/10, 10:42 »

Just multiply and divide as stated in this tech note: http://kb2.adobe.com/cps/155/tn_15542.html

Jorge
Logged

Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #2 on: 02/22/10, 21:48 »

Ahhh forgot about that little trick, many thanks!
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!