George,
You can round adding 5 to the first position that will be truncated.
Example:
If you want 2 decimal positions, add 0.005 to your value.
So:
1.3421 will be 1.3471, truncated as 1.34
1.349 will be 1.354, truncated as 1.35
Regards,
Mello
-----Mensagem Original-----
De: "OmniSoftSystems" <[EMAIL PROTECTED]>
Grupos de notícias: palm-dev-forum
Para: "Palm Developer Forum" <[EMAIL PROTECTED]>
Enviada em: Quinta-feira, 29 de Março de 2001 14:22
Assunto: Fixed-Point source ???
Hello,
Not had any luck finding source for fixed-point which is all I really need
in order to manipulate dollars & cents. So I'm having to call
FlpBase10Info, extract and reformat the strings.
Example: Instead of "-3.4560000e02", I have to display "-$3.46".
I finished the routine to convert the above value to "-$3.45". Now I need
to find out how _fp_round works so as to round to the nearest hundreds
position.
It seems like I am missing the boat somewhere. It can not be this hard to do
simple string formatting of monetary/decimal values. Is there an easier
way?
Thanks for your time...
George
--
George Aslanis
[EMAIL PROTECTED]
--
George Aslanis
[EMAIL PROTECTED]
--
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/