diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index 5b36ff0880942c2a2896a1a634b626995bde6fd5..341e49572335bec35b43dcda95bcecafb54e7daa 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -3519,7 +3519,11 @@ extern void convert_num_unit(float num, char *buf, int buf_size, int orig_type) if(orig_type < UNIT_NONE || orig_type > UNIT_PETA) orig_type = UNIT_UNKNOWN; i = (int)num; - if(i == num) + /* Here we are checking to see if these numbers are the same, + meaning the float has not floating point. If we do have + floating point print as a float. + */ + if((float)i == num) snprintf(buf, buf_size, "%d%c", i, unit[orig_type]); else snprintf(buf, buf_size, "%.2f%c", num, unit[orig_type]);