mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
Use %H when converting float cvars to strings to avoid information loss
This commit is contained in:
parent
3a0d046f7e
commit
fc54dd1ff0
1 changed files with 6 additions and 2 deletions
|
@ -281,7 +281,9 @@ const char *FBaseCVar::ToString (UCVarValue value, ECVarType type)
|
|||
break;
|
||||
|
||||
case CVAR_Float:
|
||||
mysnprintf (cstrbuf, countof(cstrbuf), "%g", value.Float);
|
||||
IGNORE_FORMAT_PRE
|
||||
mysnprintf (cstrbuf, countof(cstrbuf), "%H", value.Float);
|
||||
IGNORE_FORMAT_POST
|
||||
break;
|
||||
|
||||
case CVAR_GUID:
|
||||
|
@ -399,7 +401,9 @@ UCVarValue FBaseCVar::FromFloat (float value, ECVarType type)
|
|||
break;
|
||||
|
||||
case CVAR_String:
|
||||
mysnprintf (cstrbuf, countof(cstrbuf), "%g", value);
|
||||
IGNORE_FORMAT_PRE
|
||||
mysnprintf (cstrbuf, countof(cstrbuf), "%H", value);
|
||||
IGNORE_FORMAT_POST
|
||||
ret.String = cstrbuf;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue