Sounds like one of my homework assignments from a basic
programming course... try this on your answer sheet:
if (x == 235.1) { return(235,10); }
The answer from a book such as Advanced Palm Programming by
Mann Rischpater in chapter 3 on number conversion might also
work, but won't get you
if (x == 235.1) { return(235,10); }
LOL. now that's a really good idea. i wonder how many lines are required to
handle all the possible numbers?
markus dresch (www.palmside.com)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
: Tuesday, January 28, 2003 9:07 AM
Subject: Re: Formating a double value
if (x == 235.1) { return(235,10); }
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/
Hy!
How can I format a double value to a string like the example bellow?
a string like this:
200 to 200,00
235,1 to 235,10
2541 to 2.541,00
The last one is not very important, but i really need to know how to
transform the doubles values to string like the
27, 2003 4:23 PM
Subject: Formating a double value
Hy!
How can I format a double value to a string like the example bellow?
a string like this:
200 to 200,00
235,1 to 235,10
2541 to 2.541,00
The last one is not very important, but i really need to know how
i've got a function that does exactly that. i already posted it before, so
if you would have searched a bit you would have found the code to do that...
(STFW)
void NumFormat(Char *strP, double dvalue, short dec){
Char *buf = MemPtrNew(50);
Char *szDec = MemPtrNew(20);
Int32 lpow = pow(10, dec);