Skip to content
Snippets Groups Projects
Commit 03825ecd authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

set default number format to %g, and use it to display the time value, too
parent 45bb418e
No related branches found
No related tags found
No related merge requests found
......@@ -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" ,
......
// $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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment