public PhpNumber ToNumber() { double d; long l; var info = Convert.StringToNumber(ToString(), out l, out d); return((info & Convert.NumberInfo.Double) != 0 ? PhpNumber.Create(d) : PhpNumber.Create(l)); }
/// <summary> /// Converts given string to a number. /// </summary> public static PhpNumber ToNumber(string str) { long l; double d; var info = StringToNumber(str, out l, out d); return(((info & NumberInfo.Double) != 0) ? PhpNumber.Create(d) : PhpNumber.Create(l)); }
public static NumberInfo ToNumber(string str, out PhpNumber number) { long l; double d; var info = StringToNumber(str, out l, out d); number = ((info & NumberInfo.Double) != 0) ? PhpNumber.Create(d) : PhpNumber.Create(l); return(info); }
public Convert.NumberInfo ToNumber(out PhpNumber number) { double d; long l; var info = Convert.StringToNumber(ToString(), out l, out d); number = (info & Convert.NumberInfo.Double) != 0 ? PhpNumber.Create(d) : PhpNumber.Create(l); return(info); }
public override Convert.NumberInfo ToNumber(ref PhpValue me, out PhpNumber number) { if (me.Object is IPhpConvertible) { return(((IPhpConvertible)me.Object).ToNumber(out number)); } else { PhpException.Throw(PhpError.Notice, string.Format(Resources.ErrResources.object_could_not_be_converted, me.Object.GetType().Name, PhpVariable.TypeNameInt)); number = PhpNumber.Create(1L); return(Convert.NumberInfo.LongInteger); } }
public Convert.NumberInfo ToNumber(out PhpNumber number) { number = PhpNumber.Create(Count); return(Convert.NumberInfo.IsPhpArray | Convert.NumberInfo.LongInteger); }
public override Convert.NumberInfo ToNumber(ref PhpValue me, out PhpNumber number) { number = PhpNumber.Create(me.Boolean ? 1L : 0L); return(Convert.NumberInfo.IsNumber | Convert.NumberInfo.LongInteger); }
public override Convert.NumberInfo ToNumber(ref PhpValue me, out PhpNumber number) { number = PhpNumber.Create(me.Double); return(Convert.NumberInfo.IsNumber | Convert.NumberInfo.Double); }
public override Convert.NumberInfo ToNumber(ref PhpValue me, out PhpNumber number) { number = PhpNumber.Create(0L); return(Convert.NumberInfo.LongInteger); }
//PhpBytes IPhpConvertible.ToBinaryString(); Convert.NumberInfo IPhpConvertible.ToNumber(out PhpNumber number) { number = PhpNumber.Create(Id); return(Convert.NumberInfo.LongInteger); }