UnityEditor.TimeArea.FormatTime C# (CSharp) Method

FormatTime() public method

public FormatTime ( float time, float frameRate, TimeFormat timeFormat ) : string
time float
frameRate float
timeFormat TimeFormat
return string
        public string FormatTime(float time, float frameRate, TimeFormat timeFormat)
        {
            if (timeFormat == TimeFormat.None)
            {
                int numberOfDecimalsForMinimumDifference;
                if (frameRate != 0f)
                {
                    numberOfDecimalsForMinimumDifference = MathUtils.GetNumberOfDecimalsForMinimumDifference((float) (1f / frameRate));
                }
                else
                {
                    numberOfDecimalsForMinimumDifference = MathUtils.GetNumberOfDecimalsForMinimumDifference((float) (base.shownArea.width / base.drawRect.width));
                }
                return time.ToString("N" + numberOfDecimalsForMinimumDifference);
            }
            int num2 = Mathf.RoundToInt(time * frameRate);
            if (timeFormat == TimeFormat.TimeFrame)
            {
                int num4 = (int) frameRate;
                int length = num4.ToString().Length;
                string str2 = string.Empty;
                if (num2 < 0)
                {
                    str2 = "-";
                    num2 = -num2;
                }
                int num5 = num2 / ((int) frameRate);
                float num6 = ((float) num2) % frameRate;
                return (str2 + num5.ToString() + ":" + num6.ToString().PadLeft(length, '0'));
            }
            return num2.ToString();
        }