cvtFloatToCompactString() - handle 0.0 same as cvtDoubleToCompactString() -- 0.0 should be rendered in f format rather than g format to be "compact"

This commit is contained in:
Mark Anderson
1994-01-28 09:05:23 +00:00
parent 09651c2a9d
commit d85b931353
2 changed files with 2 additions and 2 deletions

View File

@@ -368,7 +368,7 @@ int cvtFloatToCompactString(f_value,pstr_value,f_precision)
{
#endif /*__STDC__*/
if ((f_value < 1.e4 && f_value > 1.e-4) ||
(f_value > -1.e4 && f_value < -1.e-4)) {
(f_value > -1.e4 && f_value < -1.e-4) || f_value == 0.0) {
return(cvtFloatToString(f_value,pstr_value,f_precision));
} else {
return(cvtFloatToExpString(f_value,pstr_value,f_precision));

View File

@@ -368,7 +368,7 @@ int cvtFloatToCompactString(f_value,pstr_value,f_precision)
{
#endif /*__STDC__*/
if ((f_value < 1.e4 && f_value > 1.e-4) ||
(f_value > -1.e4 && f_value < -1.e-4)) {
(f_value > -1.e4 && f_value < -1.e-4) || f_value == 0.0) {
return(cvtFloatToString(f_value,pstr_value,f_precision));
} else {
return(cvtFloatToExpString(f_value,pstr_value,f_precision));