2020-10-23 02:48 PM
May be more a problem with newlib or armgcc, but..
How to change the decimal separator from dot to coma in printf (and sprintf) ?
2020-10-24 01:42 AM
setlocale() LC_NUMERIC ??
2020-10-24 05:27 AM
Hi,
I have tried 3 ways but still got a point
//A struct lconv *ptrLocale = localeconv(); //***
// ptrLocale->decimal_point[0] = ',';
//B setlocale(LC_NUMERIC, "fr_FR");
locale_t loc = newlocale(LC_NUMERIC_MASK, "fr_FR", (locale_t) 0);
uint8_t str[100];
sprintf((char*) str, "%.2f ",12.36);
I use a stm32F746 disco with freertos and stm32ide 1.4
Regards,
JP
2022-04-15 09:03 AM
Hi,
A bit late but for me it worked with:
struct lconv *p_locale = localeconv();
p_locale->decimal_point = ",";
Regards,
AL