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)
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)
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)
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)
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)
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)
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)