From d7f94164bc2d44b7ddf39e19e90a1fc172e62c7d Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 6 Sep 2013 23:20:54 -0700 Subject: [PATCH] Fl_Dial: Use correct printf format for value display. --- src/Fl_Dial.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index fdef33d..adc9b6d 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -273,12 +273,15 @@ done: if ( _mouse_inside == this ) { /* TODO: Make this optional */ - char s[10]; + char s[128]; fl_font( FL_HELVETICA, 10 ); - snprintf( s, sizeof( s ), "%.1f", value() ); - + char buf[128]; + format(buf); + + snprintf( s, sizeof( s ), buf, value() ); + fl_color( FL_FOREGROUND_COLOR ); fl_draw( s, X, Y, S, S, FL_ALIGN_CENTER ); }