Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gcvt(3) [redhat man page]

GCVT(3) 						     Linux Programmer's Manual							   GCVT(3)

NAME
gcvt - convert a floating-point number to a string. SYNOPSIS
#include <stdlib.h> char *gcvt(double number, size_t ndigit, char *buf); DESCRIPTION
The gcvt() function converts number to a minimal length NULL terminated ASCII string and stores the result in buf. It produces ndigit sig- nificant digits in either printf(3) F format or E format. RETURN VALUE
The gcvt() function returns the address of the string pointed to by buf. SEE ALSO
ecvt(3), fcvt(3), sprintf(3) 1993-03-29 GCVT(3)

Check Out this Related Man Page

GCVT(3)                                                      Linux Programmer's Manual                                                     GCVT(3)

NAME
gcvt - convert a floating-point number to a string SYNOPSIS
#include <stdlib.h> char *gcvt(double number, int ndigit, char *buf); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): gcvt(): Since glibc 2.12: (_XOPEN_SOURCE >= 500) ! (_POSIX_C_SOURCE >= 200112L) || /* Glibc since 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _SVID_SOURCE Before glibc 2.12: _SVID_SOURCE || _XOPEN_SOURCE >= 500 DESCRIPTION
The gcvt() function converts number to a minimal length null-terminated ASCII string and stores the result in buf. It produces ndigit sig- nificant digits in either printf(3) F format or E format. RETURN VALUE
The gcvt() function returns the address of the string pointed to by buf. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |gcvt() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO
Marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specification of gcvt(), recommending the use of sprintf(3) instead (though snprintf(3) may be preferable). SEE ALSO
ecvt(3), fcvt(3), sprintf(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. 2017-09-15 GCVT(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

need help on some converting command

Hi all, i am trying to use C in unix platform to convert a double variable (floating point) to a string variable. i tried using sprintf, ecvt, fcvt,gcvt. but all gave me funny output or altered the content. does anyone know how to convert the data and keep the original content. for... (3 Replies)
Discussion started by: szeliat
3 Replies

2. Programming

scandir() and threads

I couldn't find anywhere informations about it. Is scandir() thread-safe? (4 Replies)
Discussion started by: dawwin
4 Replies

3. Programming

C code : Segmentation fault

Hi Friends, I have written a small code in C which performs the below operations Task : 1 ) read line by line from a file. 2 ) assuming 3th and 4th fields of the file as GN and GNTO 3 ) The target file should contain all the fields except GNTO. 4... (3 Replies)
Discussion started by: kiran_bhatter
3 Replies

4. UNIX for Dummies Questions & Answers

Splitting a file in a directory!

Hey guys! So I have a directory with 82 genomes in it and I have to split them up, one by one, into genes. I tried using the split function, like #!/usr/bin/perl use strict; use warnings; my $data = 'location'; my @values = split('>', $data); foreach my $val... (9 Replies)
Discussion started by: PerlNutt
9 Replies

5. UNIX for Advanced & Expert Users

Conflicts in the output of TOP command

Hi All, In the output of TOP command in my unix system, i monitored that some process has utilization more than 100% even some process has 4000% utilisation. Please help me understand how it is possible to show more than 100% utilization. Please see the screenshot below:... (2 Replies)
Discussion started by: anand2308
2 Replies

6. Solaris

DBCA Issues

I am wondering if someone can help a brother out. I am trying to create a DB using a GUI and when I am about to finish, it gets stuck. I hit finish but nothing happens. Any help from the community will be highly appreciated. ... (0 Replies)
Discussion started by: newborndba
0 Replies

7. UNIX for Dummies Questions & Answers

Delete specific strings in a file

Hi, My file has a numerous sttrings.I want to retain those strings which start with stt and delete entries with >C For eg: my infile is >C4603985... (7 Replies)
Discussion started by: sa@@
7 Replies