Hi Dean-O,
As far as I know that function outputs its data in that fashion.
The software you have written is as hard as anything else on the Palm (well
not quite - but not so far off). Palm math is exactly the same as any other
device. It's just that there is no great demand for floating point output
on the device.
The following is a simple float IO function. It suffices for my needs.
It expects positive floats and formats them in the form fore.aft.
It will have to do until you learn more.
// start code
static UInt32 power10[9]={10, 100, 1000, 10000, 100000L, 1000000L,
10000000L, 100000000L, 1000000000L};
UInt16 digits(UInt32 v)
{
UInt16 digs;
if (v < 10) digs = 1;
else if (v < 100) digs = 2;
else if (v < 1000) digs = 3;
else if (v < 10000) digs = 4;
else if (v < 100000L) digs = 5;
else if (v < 1000000L) digs = 6;
else if (v < 10000000L) digs = 7;
else if (v < 100000000L) digs = 8;
else digs = 9;
return digs;
}
/*
e.g.
double z = 123.4567 ;
Char str[16];
FormatFloat(str, 3, 4, z);
writes "123.4567" to str
*/
void FormatFloat(UInt8 * p, int fore, int aft, double d)
{
UInt32 v;
UInt16 digs;
v = d;
if (fore)
{
digs = digits(v);
while (++digs <= fore) *p++ = '0';
}
StrIToA(p, v);
if (aft != 0)
{
p += StrLen(p);
*p++ = '.';
v = ((d - (double)v) * (double)power10[aft-1]);
digs = digits(v);
while (++digs <= aft) *p++ = '0';
StrIToA(p, v);
}
}
// end code
Regards,
On 12/02/07, DeanO <[EMAIL PROTECTED]> wrote:
>
> You are correct, after the e there is a 01 for 4.0 and 5.0
> There is a 00 after the e for 3.2 and 2.3
>
> So how do I get this to stop putting data out as scientific notation?
>
> Is Palm math always this hard?
>
> Dean-O
>
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/