ncmetric: no need to use localeconv decicep with %f #545

pull/592/head
nick black 4 years ago
parent 00be9ad2e6
commit 1cc2d8a359
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -4,19 +4,6 @@
#include <pthread.h>
#include "notcurses/notcurses.h"
static const char* decisep;
static pthread_once_t ponce = PTHREAD_ONCE_INIT;
static void
convinit(void){
struct lconv* conv = localeconv();
if(conv == NULL){
return;
}
decisep = conv->decimal_point;
fesetround(FE_TOWARDZERO);
}
const char *ncmetric(uintmax_t val, unsigned decimal, char *buf, int omitdec,
unsigned mul, int uprefix){
const unsigned mult = mul; // FIXME kill
@ -26,10 +13,7 @@ const char *ncmetric(uintmax_t val, unsigned decimal, char *buf, int omitdec,
unsigned consumed = 0;
uintmax_t dv;
pthread_once(&ponce, convinit);
if(decisep == NULL){
return NULL;
}
fesetround(FE_TOWARDZERO);
if(decimal == 0 || mult == 0){
return NULL;
}

Loading…
Cancel
Save