I am infact doing the modification for the already developed application. The problem is my conduit program sends the floating point number for the price during hotsync. But the data structure used is ULong for price field . Now if i change the member (price) of the structure to float , the program doesn't work coz in some places StrIToA function is used for price. Is there any function which i can use to convert float to Ascii . I tried using Err FplFToA ( FloatType a, char* s) but got the error saying cannot convert float to struct.
Thanx, Mahesh ----- Original Message ----- From: "Stringer" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Tuesday, April 23, 2002 7:27 PM Subject: Floating point problem > >Subject: Floating point problem > >From: "Mahesh Salian" <[EMAIL PROTECTED]> > >Date: Tue, 23 Apr 2002 11:07:00 +0530 > > > >I am using Code warrior IDE with C compiler. > >Can i use float in the data structure . Is it possible to pack and unpack > >this structure if i use float. > >The flat files which i sync with my application hv the decimal digits (for > >eg. Price = 10.55 ). Can anybody suggest how could i capture this decimal > >numbers in my structure and also able to pack it. > > As a generic design concept, using float to do arithmatic on > prices is undesirable. You are better off implementing non-float > arithmetic using assumed decimal places. > Users just don't understand when 1000 units at $49.99 > calculates to $49989.99 > You are much better off converting $49.99 to 4999, multiplying > by 1000 to 4999000 and then re-inserting the decimal point > reformatting the numeric string to the perfect answer of $49990.00 > > Roger Stringer > Marietta Systems, Inc. > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
