engine/host.cpp
char const * Host_CleanupConVarStringValue( char const *invalue )
{
	static char clean[ 256 ];

	Q_snprintf( clean, sizeof( clean ), "%s", invalue );

	// Don't mess with empty string
	// Otherwise, if it appears numeric and has a decimal, try to strip all zeroes after decimal
	if ( Q_strlen( clean ) >= 1 && AppearsNumeric( clean ) && Q_strstr( clean, "." ) )
	{
		char *end = clean + strlen( clean ) - 1;
		while ( *end && end >= clean )
		{
			// Removing trailing zeros
			if ( *end != '0' )
			{
				// Remove decimal, zoo
				if ( *end == '.' )
				{
					if ( end == clean )
					{
						*end = '0';
					}
					else
					{
						*end = 0;
					}
				}
				break;
			}

			*end-- = 0;
		}
	}

	return clean;
}
//-----------------------------------------------------------------------------
// Purpose: If the value is numeric, remove unnecessary trailing zeros
// Input  : *invalue - 
// Output : char const
//-----------------------------------------------------------------------------
If the value is numeric, remove unnecessary trailing zeros
Input  : *invalue
Output : char const
If the value is numeric remove unnecessary trailing zeros Input : * invalue Output : char const
char const * Host_CleanupConVarStringValue( char const *invalue )
{
	static char clean[ 256 ];
	Q_snprintf( clean, sizeof( clean ), "%s", invalue );
	if ( Q_strlen( clean ) >= 1 && AppearsNumeric( clean ) && Q_strstr( clean, "." ) )
	{
		char *end = clean + strlen( clean ) - 1;
		while ( *end && end >= clean )
		{
			if ( *end != '0' )
			{
				if ( *end == '.' )
				{
					if ( end == clean )
					{
						*end = '0';
					}
					else
					{
						*end = 0;
					}
				}
				break;
			}
			*end-- = 0;
		}
	}
	return clean;
}
char const * Host_CleanupConVarStringValue ( char const * invalue ) { static char clean [ 256 ] ; Q_snprintf ( clean , sizeof ( clean ) , " " , invalue ) ; if ( Q_strlen ( clean ) >= 1 && AppearsNumeric ( clean ) && Q_strstr ( clean , " " ) ) { char * end = clean + strlen ( clean ) - 1 ; while ( * end && end >= clean ) { if ( * end != ' ' ) { if ( * end == ' ' ) { if ( end == clean ) { * end = ' ' ; } else { * end = 0 ; } } break ; } * end -- = 0 ; } } return clean ; }
Purpose: If the value is numeric, remove unnecessary trailing zeros
Input  : *invalue 
Output : char const
Purpose : If the value is numeric remove unnecessary trailing zeros Input : * invalue Output : char const
// Don't mess with empty string // Otherwise, if it appears numeric and has a decimal, try to strip all zeroes after decimal // Removing trailing zeros // Remove decimal, zoo