Hi Valy,
Its the same issue, you raised weeks
back....
There is no BigDecimal class Flex or Flash
ActionScript as of now. Gordon also gave some background on this issue in his
reply, he also posted a link of a _javascript_ library for the same. If
somebody can port this library to ActionScript2 it would be
useful for many.
Here is the link: http://stz-ida.de/html/oss/js_bigdecimal.html.en ,
It would take some time to port it to AS2 but its
worth doing, a good community work. I started porting the same to AS2 & I
am able to port only one part(one class) to AS2 since I am busy with work
here not sure when can I complete it.
If anyone interested to do that, I can share the
work I have done so far...
As a workaround for now, I can suggest you that you use
that _javascript_ library in your app. Do calculation in _javascript_ using that
library and pass value back to Flex app...Yeah, its a dirty way but its a
workaround until we have a ActionScript version....
-abdul
From: Valy Sivec
[mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 11:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Data Grid entry, numerical operations with bigdecimals
Sent: Monday, March 14, 2005 11:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Data Grid entry, numerical operations with bigdecimals
Hello,
I have a data entry grid and a column should be numeric ( BigDecimal in
java ). To get the correct representation of the number I transmit the number to
flex as String, to avoid the scientific representation of the number. My problem
is that in the editable grid, the user can change the numeric column(s) value
and those columns participate in some total calculations,
percentages.... displayed underneath the grid...
Problem: How should I preform the calculation without loosing the
precision? For example,
Java Bigdecimal value: 654564564645645647872
Flex: 6.54564564645646e+20
How can I avoid loosing the last decimals? in this case 47872?
Is there any way I can do that? I'll need to perform the calculation real time on the client side... I am open for suggestions... How have you treated situations like this?.
Thanks for your help,
Valy
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.