{"id":6679,"date":"2022-12-20T19:33:23","date_gmt":"2022-12-20T22:33:23","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ecvt-man3\/"},"modified":"2022-12-20T19:33:23","modified_gmt":"2022-12-20T22:33:23","slug":"ecvt-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ecvt-man3\/","title":{"rendered":"ECVT (man3)"},"content":{"rendered":"<h1 align=\"center\">ECVT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ATTRIBUTES\">ATTRIBUTES<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ecvt, fcvt \u2212 convert a floating-point number to a string<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <stdlib.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>char *ecvt(double<\/b> <i>number<\/i><b>, int<\/b> <i>ndigits<\/i><b>, int *<\/b><i>decpt<\/i><b>, int *<\/b><i>sign<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>char *fcvt(double<\/b> <i>number<\/i><b>, int<\/b> <i>ndigits<\/i><b>, int *<\/b><i>decpt<\/i><b>, int *<\/b><i>sign<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:5%; margin-top: 1em\">Feature Test Macro Requirements for glibc (see <b>feature_test_macros<\/b>(7)):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ecvt<\/b>(), <b>fcvt<\/b>():<\/p>\n<p style=\"margin-left:17%;\">Since glibc 2.12:<\/p>\n<p style=\"margin-left:23%;\">(_XOPEN_SOURCE\u00a0>=\u00a0500) ! (_POSIX_C_SOURCE\u00a0>=\u00a0200112L) <br \/> || \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Glibc since 2.19: bodies\/ usr\/ _DEFAULT_SOURCE <br \/> || \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Glibc versions <= 2.19: bodies\/ usr\/ _SVID_SOURCE<\/p>\n<p style=\"margin-left:17%;\">Before glibc 2.12:<\/p>\n<p style=\"margin-left:23%;\">_SVID_SOURCE || _XOPEN_SOURCE\u00a0>=\u00a0500<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>ecvt<\/b>() function converts <i>number<\/i> to a null-terminated string of <i>ndigits<\/i> digits (where <i>ndigits<\/i> is reduced to a system-specific limit determined by the precision of a <i>double<\/i>), and returns a pointer to the string. The high-order digit is nonzero, unless <i>number<\/i> is zero. The low order digit is rounded. The string itself does not contain a decimal point; however, the position of the decimal point relative to the start of the string is stored in <i>*decpt<\/i>. A negative value for <i>*decpt<\/i> means that the decimal point is to the left of the start of the string. If the sign of <i>number<\/i> is negative, <i>*sign<\/i> is set to a nonzero value, otherwise it is set to 0. If <i>number<\/i> is zero, it is unspecified whether <i>*decpt<\/i> is 0 or 1.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>fcvt<\/b>() function is identical to <b>ecvt<\/b>(), except that <i>ndigits<\/i> specifies the number of digits after the decimal point.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Both the <b>ecvt<\/b>() and <b>fcvt<\/b>() functions return a pointer to a static string containing the ASCII representation of <i>number<\/i>. The static string is overwritten by each call to <b>ecvt<\/b>() or <b>fcvt<\/b>().<\/p>\n<h2>ATTRIBUTES <a name=\"ATTRIBUTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of the terms used in this section, see <b>attributes<\/b>(7).<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"> <\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p align=\"center\"><img decoding=\"async\" src=\"grohtml-1614401.png\" alt=\"Image grohtml-1614401.png\"><\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">SVr2; marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specifications of <b>ecvt<\/b>() and <b>fcvt<\/b>(), recommending the use of <b>sprintf<\/b>(3) instead (though <b>snprintf<\/b>(3) may be preferable).<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Not all locales use a point as the radix character (&#8220;decimal point&#8221;).<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ecvt_r<\/b>(3), <b>gcvt<\/b>(3), <b>qecvt<\/b>(3), <b>setlocale<\/b>(3), <b>sprintf<\/b>(3)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> 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\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ecvt, fcvt \u2212 convert a floating-point number to a string <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3058,3007],"class_list":["post-6679","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-ecvt","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6679"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6679\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}