/*
* Get a string buffer before starting
*/
LIB_GETBUF(buf);
/*
* Zero out the buffer
*/
ZERO(cbuf);
/*
* Set the pointers to point at the first
* decimal place. Get a local copy of the value.
*/
cp = cpend = &cbuf[5];
val = fpv;
/*
* If we have to, decode the integral part
*/
if (!(val & 0xffff0000))
cp--;
else {
register u_short sv = (u_short)(val >> 16);
register u_short tmp;
register u_short ten = 10;
/*
* Figure out how much of the fraction to do
*/
if (msec) {
dec = (short)(ndec + 3);
if (dec < 3)
dec = 3;
cpdec = &cbuf[8];
} else {
dec = ndec;
cpdec = cpend;
}
if (dec > 6)
dec = 6;
if (dec > 0) {
do {
val &= 0xffff;
val = (val << 3) + (val << 1);
*cpend++ = (u_char)(val >> 16);
} while (--dec > 0);
}