From ca33e25e16e1ff2a242e104fc108b353900e0119 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Fri, 16 Sep 1994 18:50:18 +0000 Subject: [PATCH] For cvtDoubleToString use fixed up to 1e16 --- src/libCom/cvtFast.c | 6 +++++- src/libCom/cvtFast/cvtFast.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libCom/cvtFast.c b/src/libCom/cvtFast.c index 13453cf77..f1c678286 100644 --- a/src/libCom/cvtFast.c +++ b/src/libCom/cvtFast.c @@ -146,7 +146,11 @@ int cvtDoubleToString( /* can this routine handle this conversion */ if (precision > 8 || flt_value > 10000000.0 || flt_value < -10000000.0) { - sprintf(pstr_value,"%12.5e\0",flt_value); + if (precision > 8 || flt_value > 1e16 || flt_value < -1e16) { + sprintf(pstr_value,"%12.5e\0",flt_value); + } else { + sprintf(pstr_value,"%.0f\0",flt_value); + } return((int)strlen(pstr_value)); } startAddr = pstr_value; diff --git a/src/libCom/cvtFast/cvtFast.c b/src/libCom/cvtFast/cvtFast.c index 13453cf77..f1c678286 100644 --- a/src/libCom/cvtFast/cvtFast.c +++ b/src/libCom/cvtFast/cvtFast.c @@ -146,7 +146,11 @@ int cvtDoubleToString( /* can this routine handle this conversion */ if (precision > 8 || flt_value > 10000000.0 || flt_value < -10000000.0) { - sprintf(pstr_value,"%12.5e\0",flt_value); + if (precision > 8 || flt_value > 1e16 || flt_value < -1e16) { + sprintf(pstr_value,"%12.5e\0",flt_value); + } else { + sprintf(pstr_value,"%.0f\0",flt_value); + } return((int)strlen(pstr_value)); } startAddr = pstr_value;