-
-
Save parzibyte/33db5dcddbbb20a6dbca5e628bf8268d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <locale.h> | |
#define MAXIMA_LONGITUD_CADENA 100 | |
int main(void) | |
{ | |
char cadena[MAXIMA_LONGITUD_CADENA] = ""; | |
setlocale(LC_NUMERIC, ""); | |
long double dinero = 1234567.89; | |
snprintf(cadena, MAXIMA_LONGITUD_CADENA, "$%'.2Lf", dinero); | |
printf("La cadena formateada es '%s'", cadena); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment