[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-22 Thread Dave Wolf
What's about a Java primitive long ?

-- 
Dave Wolf
Cynergy Systems, Inc.
Adobe Flex Alliance Partner
http://www.cynergysystems.com
http://www.cynergysystems.com/blogs

Email:  [EMAIL PROTECTED]
Office: 866-CYNERGY



--- In flexcoders@yahoogroups.com, Mike_Robinson_98
[EMAIL PROTECTED] wrote:

 Dave, thanks for your response. I'm not sure what exact number type
 you have in mind (Integer?BigDecimal?). The data is decimal data, no
 getting around that. There don't seem to many choices as far as what
 data type to use. What do flex programmers do in this situation when
 they want to serialize currency values, such as item prices which have
 2 decimal precision? Convert to a String first? 
 
 It seems to me that it boils down to one thing - the data will have to
 be manipulated in *some* way once it has been reconstituted on the
 client side. This manipulation might be converting the String back to
 a Number, rounding the Number to the desired precision, or any of
 several other methods. None of which, to me, are very desirable.
 
 
 --- In flexcoders@yahoogroups.com, Dave Wolf gatorj24@ wrote:
 
  Don't use floats.  wink
  
  Seriously however, floats are inexact numeric types.  They're not 
  going to have a fixed precision in general and this is especially 
  true when they are marshalled across languages.  Can you use an 
  exact numeric type instead?
  
  -- 
  Dave Wolf
  Cynergy Systems, Inc.
  Adobe Flex Alliance Partner
  http://www.cynergysystems.com
  http://www.cynergysystems.com/blogs
  
  Email:  dave.wolf@
  Office: 866-CYNERGY
  
  
  
  
  
  --- In flexcoders@yahoogroups.com, Mike_Robinson_98 
  mike_robinson_98@ wrote:
  
   My original post seems to have gotten removed, so I am posting 
  again
   with hopes someone has experience with this issue.
   
   I am transfering float values from Java DTOs to corresponding AS
   objects using both FDS and remote objects. The Java float values 
  have
   a precision of 4 decimal places (verified before serialization e.g.
   0.4398) yet when they are created in AS they have 16 decimal places
   with values extending throughout the 16 digits (e.g.
   0.4398283772047382). I suppose I can round the values when I 
  receive
   them at the client, but can someone tell me if there's a better 
  way to
   insure the destination values are the same as the source?
   
   Thanks,
   Mike
  
 








 Yahoo! Groups Sponsor ~-- 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
~- 

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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-22 Thread Dave Wolf
It might for the marshalling, but don't go around doing currency
calculations with a double.  It is inexact like float.

Then again.  Maybe you could skim that 100ths of cents off and...

-- 
Dave Wolf
Cynergy Systems, Inc.
Adobe Flex Alliance Partner
http://www.cynergysystems.com
http://www.cynergysystems.com/blogs

Email:  [EMAIL PROTECTED]
Office: 866-CYNERGY


--- In flexcoders@yahoogroups.com, Mike_Robinson_98
[EMAIL PROTECTED] wrote:

 Yes, that definitely does the trick. Thanks for your help.
 
 --- In flexcoders@yahoogroups.com, Peter Farland pfarland@ wrote:
 
  As a work around for now, try using double instead of float.
  
   
  
   
  
   
  
  
  
  From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
  Behalf Of Mike_Robinson_98
  Sent: Friday, July 21, 2006 5:00 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Re: AMF serialization of floats (REPOST)
  
   
  
  Dave, thanks for your response. I'm not sure what exact number type
  you have in mind (Integer?BigDecimal?). The data is decimal data, no
  getting around that. There don't seem to many choices as far as what
  data type to use. What do flex programmers do in this situation when
  they want to serialize currency values, such as item prices which have
  2 decimal precision? Convert to a String first? 
  
  It seems to me that it boils down to one thing - the data will have to
  be manipulated in *some* way once it has been reconstituted on the
  client side. This manipulation might be converting the String back to
  a Number, rounding the Number to the desired precision, or any of
  several other methods. None of which, to me, are very desirable.
  
  --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
  , Dave Wolf gatorj24@ wrote:
  
   Don't use floats. wink
   
   Seriously however, floats are inexact numeric types. They're not 
   going to have a fixed precision in general and this is especially 
   true when they are marshalled across languages. Can you use an 
   exact numeric type instead?
   
   -- 
   Dave Wolf
   Cynergy Systems, Inc.
   Adobe Flex Alliance Partner
   http://www.cynergysystems.com http://www.cynergysystems.com 
   http://www.cynergysystems.com/blogs
  http://www.cynergysystems.com/blogs 
   
   Email: dave.wolf@
   Office: 866-CYNERGY
   
   
   
   
   
   --- In flexcoders@yahoogroups.com
  mailto:flexcoders%40yahoogroups.com , Mike_Robinson_98 
   mike_robinson_98@ wrote:
   
My original post seems to have gotten removed, so I am posting 
   again
with hopes someone has experience with this issue.

I am transfering float values from Java DTOs to corresponding AS
objects using both FDS and remote objects. The Java float values 
   have
a precision of 4 decimal places (verified before serialization
e.g.
0.4398) yet when they are created in AS they have 16 decimal
places
with values extending throughout the 16 digits (e.g.
0.4398283772047382). I suppose I can round the values when I 
   receive
them at the client, but can someone tell me if there's a better 
   way to
insure the destination values are the same as the source?

Thanks,
Mike
   
  
 







 Yahoo! Groups Sponsor ~-- 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
~- 

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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Dave Wolf
Don't use floats.  wink

Seriously however, floats are inexact numeric types.  They're not 
going to have a fixed precision in general and this is especially 
true when they are marshalled across languages.  Can you use an 
exact numeric type instead?

-- 
Dave Wolf
Cynergy Systems, Inc.
Adobe Flex Alliance Partner
http://www.cynergysystems.com
http://www.cynergysystems.com/blogs

Email:  [EMAIL PROTECTED]
Office: 866-CYNERGY





--- In flexcoders@yahoogroups.com, Mike_Robinson_98 
[EMAIL PROTECTED] wrote:

 My original post seems to have gotten removed, so I am posting 
again
 with hopes someone has experience with this issue.
 
 I am transfering float values from Java DTOs to corresponding AS
 objects using both FDS and remote objects. The Java float values 
have
 a precision of 4 decimal places (verified before serialization e.g.
 0.4398) yet when they are created in AS they have 16 decimal places
 with values extending throughout the 16 digits (e.g.
 0.4398283772047382). I suppose I can round the values when I 
receive
 them at the client, but can someone tell me if there's a better 
way to
 insure the destination values are the same as the source?
 
 Thanks,
 Mike







 Yahoo! Groups Sponsor ~-- 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/nhFolB/TM
~- 

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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Mike_Robinson_98
Dave, thanks for your response. I'm not sure what exact number type
you have in mind (Integer?BigDecimal?). The data is decimal data, no
getting around that. There don't seem to many choices as far as what
data type to use. What do flex programmers do in this situation when
they want to serialize currency values, such as item prices which have
2 decimal precision? Convert to a String first? 

It seems to me that it boils down to one thing - the data will have to
be manipulated in *some* way once it has been reconstituted on the
client side. This manipulation might be converting the String back to
a Number, rounding the Number to the desired precision, or any of
several other methods. None of which, to me, are very desirable.


--- In flexcoders@yahoogroups.com, Dave Wolf [EMAIL PROTECTED] wrote:

 Don't use floats.  wink
 
 Seriously however, floats are inexact numeric types.  They're not 
 going to have a fixed precision in general and this is especially 
 true when they are marshalled across languages.  Can you use an 
 exact numeric type instead?
 
 -- 
 Dave Wolf
 Cynergy Systems, Inc.
 Adobe Flex Alliance Partner
 http://www.cynergysystems.com
 http://www.cynergysystems.com/blogs
 
 Email:  [EMAIL PROTECTED]
 Office: 866-CYNERGY
 
 
 
 
 
 --- In flexcoders@yahoogroups.com, Mike_Robinson_98 
 mike_robinson_98@ wrote:
 
  My original post seems to have gotten removed, so I am posting 
 again
  with hopes someone has experience with this issue.
  
  I am transfering float values from Java DTOs to corresponding AS
  objects using both FDS and remote objects. The Java float values 
 have
  a precision of 4 decimal places (verified before serialization e.g.
  0.4398) yet when they are created in AS they have 16 decimal places
  with values extending throughout the 16 digits (e.g.
  0.4398283772047382). I suppose I can round the values when I 
 receive
  them at the client, but can someone tell me if there's a better 
 way to
  insure the destination values are the same as the source?
  
  Thanks,
  Mike
 







 Yahoo! Groups Sponsor ~-- 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
~- 

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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Peter Farland












Mike, can you send me a clear and simple
test case containing Java and AS source as an example of the issue?











From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike_Robinson_98
Sent: Friday, July 21, 2006 5:00
PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: AMF
serialization of floats (REPOST)











Dave, thanks for your response. I'm not sure what
exact number type
you have in mind (Integer?BigDecimal?). The data is decimal data, no
getting around that. There don't seem to many choices as far as what
data type to use. What do flex programmers do in this situation when
they want to serialize currency values, such as item prices which have
2 decimal precision? Convert to a String first? 

It seems to me that it boils down to one thing - the data will have to
be manipulated in *some* way once it has been reconstituted on the
client side. This manipulation might be converting the String back to
a Number, rounding the Number to the desired precision, or any of
several other methods. None of which, to me, are very desirable.

--- In [EMAIL PROTECTED]ups.com,
Dave Wolf [EMAIL PROTECTED]. wrote:

 Don't use floats. wink
 
 Seriously however, floats are inexact numeric types. They're not 
 going to have a fixed precision in general and this is especially 
 true when they are marshalled across languages. Can you use an 
 exact numeric type instead?
 
 -- 
 Dave Wolf
 Cynergy Systems, Inc.
 Adobe Flex Alliance
Partner
 http://www.cynergysystems.com
 http://www.cynergysystems.com/blogs
 
 Email: [EMAIL PROTECTED].
 Office: 866-CYNERGY
 
 
 
 
 
 --- In [EMAIL PROTECTED]ups.com,
Mike_Robinson_98 
 mike_robinson_98@ wrote:
 
  My original post seems to have gotten removed, so I am posting 
 again
  with hopes someone has experience with this issue.
  
  I am transfering float values from Java DTOs to corresponding AS
  objects using both FDS and remote objects. The Java float values 
 have
  a precision of 4 decimal places (verified before serialization e.g.
  0.4398) yet when they are created in AS they have 16 decimal places
  with values extending throughout the 16 digits (e.g.
  0.4398283772047382). I suppose I can round the values when I 
 receive
  them at the client, but can someone tell me if there's a better 
 way to
  insure the destination values are the same as the source?
  
  Thanks,
  Mike
 







__._,_.___





--
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
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___






[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Mike_Robinson_98
Peter, I would be happy to. Give me a little bit to put something
togather. Do you want me to send it to you personally or post here?

-Mike

--- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote:

 Mike, can you send me a clear and simple test case containing Java and
 AS source as an example of the issue?
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Mike_Robinson_98
 Sent: Friday, July 21, 2006 5:00 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: AMF serialization of floats (REPOST)
 
  
 
 Dave, thanks for your response. I'm not sure what exact number type
 you have in mind (Integer?BigDecimal?). The data is decimal data, no
 getting around that. There don't seem to many choices as far as what
 data type to use. What do flex programmers do in this situation when
 they want to serialize currency values, such as item prices which have
 2 decimal precision? Convert to a String first? 
 
 It seems to me that it boils down to one thing - the data will have to
 be manipulated in *some* way once it has been reconstituted on the
 client side. This manipulation might be converting the String back to
 a Number, rounding the Number to the desired precision, or any of
 several other methods. None of which, to me, are very desirable.
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Dave Wolf gatorj24@ wrote:
 
  Don't use floats. wink
  
  Seriously however, floats are inexact numeric types. They're not 
  going to have a fixed precision in general and this is especially 
  true when they are marshalled across languages. Can you use an 
  exact numeric type instead?
  
  -- 
  Dave Wolf
  Cynergy Systems, Inc.
  Adobe Flex Alliance Partner
  http://www.cynergysystems.com http://www.cynergysystems.com 
  http://www.cynergysystems.com/blogs
 http://www.cynergysystems.com/blogs 
  
  Email: dave.wolf@
  Office: 866-CYNERGY
  
  
  
  
  
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , Mike_Robinson_98 
  mike_robinson_98@ wrote:
  
   My original post seems to have gotten removed, so I am posting 
  again
   with hopes someone has experience with this issue.
   
   I am transfering float values from Java DTOs to corresponding AS
   objects using both FDS and remote objects. The Java float values 
  have
   a precision of 4 decimal places (verified before serialization e.g.
   0.4398) yet when they are created in AS they have 16 decimal places
   with values extending throughout the 16 digits (e.g.
   0.4398283772047382). I suppose I can round the values when I 
  receive
   them at the client, but can someone tell me if there's a better 
  way to
   insure the destination values are the same as the source?
   
   Thanks,
   Mike
  
 







 Yahoo! Groups Sponsor ~-- 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
~- 

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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Peter Farland












As a work around for now, try using double
instead of float.















From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf
Of Mike_Robinson_98
Sent: Friday, July 21, 2006 5:00
PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: AMF
serialization of floats (REPOST)











Dave, thanks for your response. I'm not sure what
exact number type
you have in mind (Integer?BigDecimal?). The data is decimal data, no
getting around that. There don't seem to many choices as far as what
data type to use. What do flex programmers do in this situation when
they want to serialize currency values, such as item prices which have
2 decimal precision? Convert to a String first? 

It seems to me that it boils down to one thing - the data will have to
be manipulated in *some* way once it has been reconstituted on the
client side. This manipulation might be converting the String back to
a Number, rounding the Number to the desired precision, or any of
several other methods. None of which, to me, are very desirable.

--- In [EMAIL PROTECTED]ups.com,
Dave Wolf [EMAIL PROTECTED]. wrote:

 Don't use floats. wink
 
 Seriously however, floats are inexact numeric types. They're not 
 going to have a fixed precision in general and this is especially 
 true when they are marshalled across languages. Can you use an 
 exact numeric type instead?
 
 -- 
 Dave Wolf
 Cynergy Systems, Inc.
 Adobe Flex Alliance
Partner
 http://www.cynergysystems.com
 http://www.cynergysystems.com/blogs
 
 Email: [EMAIL PROTECTED].
 Office: 866-CYNERGY
 
 
 
 
 
 --- In [EMAIL PROTECTED]ups.com,
Mike_Robinson_98 
 mike_robinson_98@ wrote:
 
  My original post seems to have gotten removed, so I am posting 
 again
  with hopes someone has experience with this issue.
  
  I am transfering float values from Java DTOs to corresponding AS
  objects using both FDS and remote objects. The Java float values 
 have
  a precision of 4 decimal places (verified before serialization e.g.
  0.4398) yet when they are created in AS they have 16 decimal places
  with values extending throughout the 16 digits (e.g.
  0.4398283772047382). I suppose I can round the values when I 
 receive
  them at the client, but can someone tell me if there's a better 
 way to
  insure the destination values are the same as the source?
  
  Thanks,
  Mike
 







__._,_.___





--
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
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___






[flexcoders] Re: AMF serialization of floats (REPOST)

2006-07-21 Thread Mike_Robinson_98
Yes, that definitely does the trick. Thanks for your help.

--- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote:

 As a work around for now, try using double instead of float.
 
  
 
  
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Mike_Robinson_98
 Sent: Friday, July 21, 2006 5:00 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: AMF serialization of floats (REPOST)
 
  
 
 Dave, thanks for your response. I'm not sure what exact number type
 you have in mind (Integer?BigDecimal?). The data is decimal data, no
 getting around that. There don't seem to many choices as far as what
 data type to use. What do flex programmers do in this situation when
 they want to serialize currency values, such as item prices which have
 2 decimal precision? Convert to a String first? 
 
 It seems to me that it boils down to one thing - the data will have to
 be manipulated in *some* way once it has been reconstituted on the
 client side. This manipulation might be converting the String back to
 a Number, rounding the Number to the desired precision, or any of
 several other methods. None of which, to me, are very desirable.
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Dave Wolf gatorj24@ wrote:
 
  Don't use floats. wink
  
  Seriously however, floats are inexact numeric types. They're not 
  going to have a fixed precision in general and this is especially 
  true when they are marshalled across languages. Can you use an 
  exact numeric type instead?
  
  -- 
  Dave Wolf
  Cynergy Systems, Inc.
  Adobe Flex Alliance Partner
  http://www.cynergysystems.com http://www.cynergysystems.com 
  http://www.cynergysystems.com/blogs
 http://www.cynergysystems.com/blogs 
  
  Email: dave.wolf@
  Office: 866-CYNERGY
  
  
  
  
  
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , Mike_Robinson_98 
  mike_robinson_98@ wrote:
  
   My original post seems to have gotten removed, so I am posting 
  again
   with hopes someone has experience with this issue.
   
   I am transfering float values from Java DTOs to corresponding AS
   objects using both FDS and remote objects. The Java float values 
  have
   a precision of 4 decimal places (verified before serialization e.g.
   0.4398) yet when they are created in AS they have 16 decimal places
   with values extending throughout the 16 digits (e.g.
   0.4398283772047382). I suppose I can round the values when I 
  receive
   them at the client, but can someone tell me if there's a better 
  way to
   insure the destination values are the same as the source?
   
   Thanks,
   Mike
  
 







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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/