If you have numbers with exactly 2 decimal places, then...

*    Remove the decimal point from the two numbers.
*    Do an StrAToI().
*    Add them together.
*    Do and StrIToA().
*    Finally, Insert the decimal point back to accomodate the two digits
     after the decimal point

(xxx,xxx,xxx.xx)  positive / negative is easily accomodated in an Int32.

Float manager is great, but this WORKS.

hope this helps,
Prashant Gupta






"Nicolas Raitman" <[EMAIL PROTECTED]> on 02/01/2001 10:49:11 PM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (bcc: Gupta Prashant-SWD-ITIL-UB/Itilmail)

Subject:  floats




OK... I cannot believe that I am stuck with this. The situation is this. I
have some strings and I want to convert them to floats or doubles in order
to sum all of them and then turn the result again to string so that I can
show it. The problem is that I cannot do it... please... I am really
stuck... those of you who already know it, please help. I just want to get
a
number like 2343.33, only 2 decimal places... how can I do this?

 FlpCompDouble   Saldo;
Saldo.fd = FlpAToF( (char *) Factura.Total);
/* I know that here Saldo.d will contain a number that I can use, but I do
not know in which way
to turn that number into a string*/

Please help, the numbers I will be dealing will be like xxx,xxx,xxx.xx

Do you see... there aren't that big... so??
Thanks,
Nicolas



--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to