s _fcvt - Globalyzer Internationalization Help

Internationalization and localization tools


Character Manipulation Function

char* fcvt(double value, int ndigit, int *decpt, int *neg);

char* _fcvt(double value, int ndigit, int *decpt, int *neg);

Internationalization (I18n) Function Overview

The function fcvt is like ecvt, but ndigit specifies the number of digits after the decimal point. If ndigit is less than zero, value is rounded to the ndigit+1'th place to the left of the decimal point. For example, if ndigit is -1, value will be rounded to the nearest 10. If ndigit is negative and larger than the number of digits to the left of the decimal point in value, value will be rounded to one significant digit.

_fcvt is the Windows-only version of fcvt.

I18n Issues

fcvt/_fcvt should not be used for strings that will be displayed to the user because the decimal separator and the position of the sign byte are not dependent on the numeric settings of the user's locale. In addition, these functions cannot be used with wide character strings.

Alternatively, one of the sprintf functions should be used, as these functions use the setting of the user locale's LC_NUMERIC category when formatting floating-point values. See String Formatting in C and C++ for a discussion on locale-sensitive formatting in internationalized applications.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Character Manipulation Functions

 

Lingoport internationalization and localization services and software