From beecb5580fce1b87093b57e17e7992b8c2406991 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 3 Mar 2003 17:52:11 +0000 Subject: [PATCH] use %g instead of %f and the 0s hack --- libs/util/cvar.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libs/util/cvar.c b/libs/util/cvar.c index a8f72fc9f..073f71a7f 100644 --- a/libs/util/cvar.c +++ b/libs/util/cvar.c @@ -282,18 +282,12 @@ Cvar_SetROM (cvar_t *var, const char *value) var->callback (var); } -// 1999-09-07 weird cvar zeros fix by Maddes void Cvar_SetValue (cvar_t *var, float value) { char val[32]; - int i; - snprintf (val, sizeof (val), "%f", value); - for (i = strlen (val) - 1; i > 0 && val[i] == '0' && val[i - 1] != '.'; - i--) { - val[i] = 0; - } + snprintf (val, sizeof (val), "%g", value); Cvar_Set (var, val); }