diff --git a/common/pr_cmds.c b/common/pr_cmds.c index 7a58f40..42338d8 100644 --- a/common/pr_cmds.c +++ b/common/pr_cmds.c @@ -1038,12 +1038,22 @@ char pr_string_temp[128]; void PF_ftos (void) { float v; + int i; // 1999-07-25 FTOS fix by Maddes + v = G_FLOAT(OFS_PARM0); if (v == (int)v) snprintf(pr_string_temp, sizeof(pr_string_temp), "%d",(int)v); else - snprintf(pr_string_temp, sizeof(pr_string_temp), "%5.1f",v); +// 1999-07-25 FTOS fix by Maddes start + { + snprintf(pr_string_temp, sizeof(pr_string_temp), "%1f",v); + for (i=Q_strlen(pr_string_temp)-1 ; i>0 && pr_string_temp[i]=='0' && pr_string_temp[i-1]!='.' ; i--) + { + pr_string_temp[i] = 0; + } + } +// 1999-07-25 FTOS fix by Maddes end G_INT(OFS_RETURN) = PR_SetString(pr_string_temp); }