ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

gcvt.c
Go to the documentation of this file.
00001 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
00002 #include <precomp.h>
00003 
00004 /*
00005  * @implemented
00006  */
00007 char *
00008 _gcvt (double value, int ndigits, char *buf)
00009 {
00010   char *p = buf;
00011 
00012   sprintf (buf, "%-#.*g", ndigits, value);
00013 
00014   /* It seems they expect us to return .XXXX instead of 0.XXXX  */
00015   if (*p == '-')
00016     p++;
00017   if (*p == '0' && p[1] == '.')
00018     memmove (p, p + 1, strlen (p + 1) + 1);
00019 
00020   /* They want Xe-YY, not X.e-YY, and XXXX instead of XXXX.  */
00021   p = strchr (buf, 'e');
00022   if (!p)
00023     {
00024       p = buf + strlen (buf);
00025       /* They don't want trailing zeroes.  */
00026       while (p[-1] == '0' && p > buf + 2)
00027     *--p = '\0';
00028     }
00029   if (p > buf && p[-1] == '.')
00030     memmove (p - 1, p, strlen (p) + 1);
00031   return buf;
00032 }

Generated on Sun May 27 2012 04:36:37 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.