diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 751e0f7b64d7bc96661a7a33a0fa5cf122dfb986..eea7163bd3e5147f581536e9b54cc36f6313df3e 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -365,12 +365,12 @@ StringXString PostProcessingOptions_String[] = { StringXString ViewOptions_String[] = { { F|O, "AbscissaName" , opt_view_abscissa_name , "" , "Abscissa name for 2D graphs" }, - { F|O, "AbscissaFormat" , opt_view_abscissa_format , "%.3e" , + { F|O, "AbscissaFormat" , opt_view_abscissa_format , "%g" , "Abscissa number format for 2D graphs (in standard C form)" }, { F, "FileName" , opt_view_filename , "" , "Default post-processing view file name" }, - { F|O, "Format" , opt_view_format , "%.3e" , + { F|O, "Format" , opt_view_format , "%g" , "Number format (in standard C form)" }, { F|O, "GeneralizedRaiseX" , opt_view_gen_raise0 , "v0" , diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp index 46b120fa1cc11df8433a579060412d3033d86993..3e301f0cfd8855abf200374acb0c737dd9b8c031 100644 --- a/Graphics/Scale.cpp +++ b/Graphics/Scale.cpp @@ -1,4 +1,4 @@ -// $Id: Scale.cpp,v 1.55 2005-01-01 19:35:29 geuzaine Exp $ +// $Id: Scale.cpp,v 1.56 2005-01-18 05:31:04 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -268,8 +268,11 @@ void draw_scale(Post_View * v, // the label if((v->ShowTime == 1 && List_Nbr(v->Time) > 1) || - (v->ShowTime == 2 && List_Nbr(v->Time) > 0)) - sprintf(label, "%s (%g)", v->Name, *(double *)List_Pointer(v->Time, v->TimeStep)); + (v->ShowTime == 2 && List_Nbr(v->Time) > 0)){ + char tmp[256]; + sprintf(tmp, v->Format, *(double *)List_Pointer(v->Time, v->TimeStep)); + sprintf(label, "%s (%s)", v->Name, tmp); + } else sprintf(label, "%s", v->Name); @@ -378,8 +381,11 @@ void Draw_Scales(void) width_prev = width; sprintf(label, v->Format, -100*M_PI); width = bar_size + tic + gl_width(label); - if(List_Nbr(v->Time) > 1 && v->ShowTime) - sprintf(label, "%s (%g)", v->Name, *(double *)List_Pointer(v->Time, v->TimeStep)); + if(List_Nbr(v->Time) > 1 && v->ShowTime){ + char tmp[256]; + sprintf(tmp, v->Format, *(double *)List_Pointer(v->Time, v->TimeStep)); + sprintf(label, "%s (%s)", v->Name, tmp); + } else sprintf(label, "%s", v->Name); if(gl_width(label) > width)