diff --git a/trick_source/sim_services/VariableServer/vs_format_ascii.cpp b/trick_source/sim_services/VariableServer/vs_format_ascii.cpp index c62f5f56..b3c940a8 100644 --- a/trick_source/sim_services/VariableServer/vs_format_ascii.cpp +++ b/trick_source/sim_services/VariableServer/vs_format_ascii.cpp @@ -137,23 +137,23 @@ int vs_format_ascii(Trick::VariableReference * var, char *value) { break; case TRICK_FLOAT: - sprintf(value, "%s%-14.8g", value, var->conversion_factor->eval(*(float *)buf_ptr)); + sprintf(value, "%s%.8g", value, var->conversion_factor->eval(*(float *)buf_ptr)); break; case TRICK_DOUBLE: - sprintf(value, "%s%-21.16g", value, var->conversion_factor->eval(*(double *)buf_ptr)); + sprintf(value, "%s%.16g", value, var->conversion_factor->eval(*(double *)buf_ptr)); break; case TRICK_LONG_LONG: - // This is a work-round for when terminate_time is not defined and is requested through variable server. - // When sim terminate time is not defined, the related variable is the max of the type. - // The unit conversion calculation will throw floating point exception. - // For trick_sys.sched.terminate_time, there is no need to perform such conversion. - if (!var_name.compare("trick_sys.sched.terminate_time")) { - sprintf(value, "%s%lld", value, *(long long *)buf_ptr); - } else { - sprintf(value, "%s%lld", value, (long long)var->conversion_factor->eval(*(long long *)buf_ptr)); - } + // This is a work-round for when terminate_time is not defined and is requested through variable server. + // When sim terminate time is not defined, the related variable is the max of the type. + // The unit conversion calculation will throw floating point exception. + // For trick_sys.sched.terminate_time, there is no need to perform such conversion. + if (!var_name.compare("trick_sys.sched.terminate_time")) { + sprintf(value, "%s%lld", value, *(long long *)buf_ptr); + } else { + sprintf(value, "%s%lld", value, (long long)var->conversion_factor->eval(*(long long *)buf_ptr)); + } break; case TRICK_UNSIGNED_LONG_LONG: @@ -163,7 +163,7 @@ int vs_format_ascii(Trick::VariableReference * var, char *value) { case TRICK_NUMBER_OF_TYPES: sprintf(value, "BAD_REF" ); break; - + default:{ return (-1); }