Microsoft.JScript.NumberPrototype.ThisobToDouble C# (CSharp) Method

ThisobToDouble() private static method

private static ThisobToDouble ( Object thisob ) : double
thisob Object
return double
      private static double ThisobToDouble(Object thisob){
        thisob = NumberPrototype.valueOf(thisob);
        return ((IConvertible)thisob).ToDouble(null);
      }
      

Usage Example

コード例 #1
0
        public static String toExponential(Object thisob, Object fractionDigits)
        {
            double value = NumberPrototype.ThisobToDouble(thisob);
            double f;

            if (fractionDigits == null || fractionDigits is Missing)
            {
                f = 16;
            }
            else
            {
                f = Convert.ToInteger(fractionDigits);
            }
            if (f < 0 || f > 20)
            {
                throw new JScriptException(JSError.FractionOutOfRange);
            }
            StringBuilder fmt = new StringBuilder("#.");

            for (int i = 0; i < f; i++)
            {
                fmt.Append('0');
            }
            fmt.Append("e+0");
            return(value.ToString(fmt.ToString(), CultureInfo.InvariantCulture));
        }
All Usage Examples Of Microsoft.JScript.NumberPrototype::ThisobToDouble