Small cleanup of extensions code
[AROS.git] / compiler / clib / gcvt.c
blob767d83b0300f67c0b2095933fd27bcf2856f2ae2
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function gcvt().
6 */
8 #include <stdio.h>
10 /*****************************************************************************
12 NAME */
13 #include <stdlib.h>
15 char * gcvt (
17 /* SYNOPSIS */
18 double number,
19 int ndigit,
20 char * buf
23 /* FUNCTION
24 Converts a number to a minimal length NULL terminated ASCII string.
25 It produces ndigit significant digits in either printf F format or
26 E format.
28 INPUTS
29 number - The number to convert.
30 ndigits - The number of significan digits that the string has to have.
31 buf - The buffer that will contain the result string.
33 RESULT
34 The address of the string pointed to by buf.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 ecvt(), fcvt(), sprintf()
45 INTERNALS
47 ******************************************************************************/
49 sprintf (buf, "%.*G", ndigit, number);
51 return buf;
52 } /* sprintf */