Formatting float into string

Discuss PocketC for CE (including Desktop Edition)

Postby mister_zed on Wed Jul 10, 2002 1:06 pm

I tried to use the format function to conevrt floating values into strings with arbitrary precision. It didn't work. The only thing it returned was a string with ONE character in it "f".

What am I doing wrong? I tested this in PocketC 3.01 on Compaq Aero 2100 running PocketPC (MIPS CPU) and on Compaq C-Series (CE 2.0, MIPS). Same result in both cases.
Posts: 3
Joined: Tue Jul 09, 2002 5:06 pm

Postby wolfgang on Wed Jul 10, 2002 2:54 pm


I was testing a program for another guy, and got the same problem - all numbers that were supposed to be formatted with the "format" function yielded "f" instead. It ran fine on his device (Jornada HPC Pro with WinCE 2.11), but not on mine (LG Phenom HPC with WinCE 2.0). He was using PocketC V3. to compile. It also ran fine when compiling with PocketC V2, but I don't know if this is an option for you. We finally gave up, and I wrote a replacment format function in PocketC, which works well. The only difference to the built-in function is that mine does not do any rounding, it simply truncates, but this could be remedied. If you are interested in the source code, please send me a note to

and I'll send you the source right away. If more people are interested, I can post it on this forum.


Composing music on the PocketPC! -
Composing music on the PocketPC! -
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests