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:
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user