Beispiel #1
0
        public float ArgTo0to1(float arg)
        {
            string stringVal;

            try
            {
                stringVal = arg.ToString();
            }
            catch (Exception e)
            {
                return(0);
            }

            float val = (float)CoreMath.ParseDouble(stringVal);

            if (val < 0)
            {
                val = 0;
            }
            if (val > 1)
            {
                val = 1;
            }

            return(val);
        }