A voir également:
- Conversion
- Monnaie conversion - Télécharger - Banque & Budget
- Conversion ascii - Guide
- Conversion majuscule minuscule - Guide
- Conversion mb en go ✓ - Forum Mail
- Tableau conversion heure en centième ✓ - Forum Excel
1 réponse
salut
tu peux utiliser cette fonction:
char *_ecvt( double value, int count, int *dec, int *sign );
value:Number to be converted
count:Number of digits stored
dec:Stored decimal-point position
sign:Sign of converted number
avec un #include "stdlib.h"
voici un exemple :
/* ECVT.C: This program uses _ecvt to convert a
* floating-point number to a character string.
*/
#include <stdlib.h>
#include <stdio.h>
void main( void )
{
int decimal, sign;
char *buffer;
int precision = 10;
double source = 3.1415926535;
buffer = _ecvt( source, precision, &decimal, &sign );
printf( "source: %2.10f buffer: '%s' decimal: %d sign: %d\n",
source, buffer, decimal, sign );
}
Output
source: 3.1415926535 buffer: '3141592654' decimal: 1 sign: 0
J'espere t'avoir aide
tu peux utiliser cette fonction:
char *_ecvt( double value, int count, int *dec, int *sign );
value:Number to be converted
count:Number of digits stored
dec:Stored decimal-point position
sign:Sign of converted number
avec un #include "stdlib.h"
voici un exemple :
/* ECVT.C: This program uses _ecvt to convert a
* floating-point number to a character string.
*/
#include <stdlib.h>
#include <stdio.h>
void main( void )
{
int decimal, sign;
char *buffer;
int precision = 10;
double source = 3.1415926535;
buffer = _ecvt( source, precision, &decimal, &sign );
printf( "source: %2.10f buffer: '%s' decimal: %d sign: %d\n",
source, buffer, decimal, sign );
}
Output
source: 3.1415926535 buffer: '3141592654' decimal: 1 sign: 0
J'espere t'avoir aide