ecvt.3
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 98 行
3
98 行
.\" SCCSID: @(#)ecvt.3 2.4 8/10/87.TH ecvt 3 .SH Nameecvt, fcvt, gcvt \- output conversion.SH Syntax.nf.B char *ecvt(\fIvalue, ndigit, decpt, sign\fP).B double value;.B int \fIndigit, *decpt, *sign\fP;.PP.B char *fcvt(\fIvalue, ndigit, decpt, sign\fP).B double value;.B int \fIndigit, *decpt, *sign\fP;.PP.B char *gcvt(\fIvalue, ndigit, buf\fP).B double value;.B char \fI*buf\fP;.fi.SH Description.NXR "ecvt subroutine".NXR "fcvt subroutine".NXR "gcvt subroutine".NXR "ASCII string" "converting to"The.PN ecvtroutine converts the .I valueto a null-terminated string of.I ndigitASCII digits and returns a pointer thereto.The position of the radix character relative to thebeginning of the string is stored indirectly through.I decpt (negative means to the left of the returned digits).If the sign of the result is negative, the word pointed to by.I sign is non-zero, otherwise it is zero. The low-order digit is rounded..PPThe.PN fcvt routine is identical to .PN ecvt ,except that the correct digithas been rounded for FORTRAN F-format output of the numberof digits specified by.IR \(*_ndigits ..PPThe.PN gcvtroutine converts the.I valueto a null-terminated ASCII string in.I bufand returns a pointer to .I buf.It attempts to produce.I ndigitsignificant digits in FORTRAN F format if possible, otherwise E format isused, ready for printing. Trailing zeros may be suppressed..PPThe symbol used to represent a radix character is obtained from the lastsuccessful call to.PN setlocalecategory.PN LC_NUMERIC .The symbol can be determined by calling:.EXnl_langinfo (RADIXCHAR);.EE.PPIf.PN setlocalecategory.PN LC_NUMERIChas not been called successfully, or if the radix character is not defined for a supported language, the radix character defaults to a period (.)..SS International Environment.IP LC_NUMERIC 15If this environment is set and valid, .PN ecvtuses the international language database named in the definition to determineradix character rules. .IP LANG 15If this environment is set and valid, .PN ecvtuses the international language database named in the definition to determineradix character rules. If .PN LC_NUMERICis defined, its definition supercedes the definition of .PN LANG. .SH RestrictionsThe return values point to static datawhose content is overwritten by each call..SH See Alsosetlocale(3), nl_langinfo(3int), printf(3int), printf(3s).br.I Guide to Developing International Software
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?