Skip to content

Commit ea3b1f0

Browse files
author
linzhijun
committed
添加 DoubleValue
1 parent 924177e commit ea3b1f0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

csharp/ToolGood.Algorithm2/Operand.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ public abstract class Operand : IDisposable
5454
/// </summary>
5555
public virtual decimal NumberValue => throw new NotImplementedException();
5656
/// <summary>
57-
/// int值
57+
/// double值
5858
/// </summary>
59-
public virtual int IntValue => throw new NotImplementedException();
59+
public virtual double DoubleValue => throw new NotImplementedException();
60+
/// <summary>
61+
/// int值
62+
/// </summary>
63+
public virtual int IntValue => throw new NotImplementedException();
6064
/// <summary>
6165
/// long值
6266
/// </summary>
@@ -518,8 +522,9 @@ public OperandNumber(decimal obj) : base(obj) { }
518522
public override int IntValue => (int)_value;
519523
public override decimal NumberValue => _value;
520524
public override long LongValue => (long)_value;
525+
public override double DoubleValue => (double)_value;
521526

522-
public override Operand ToNumber(string errorMessage = null) { return this; }
527+
public override Operand ToNumber(string errorMessage = null) { return this; }
523528
public override Operand ToBoolean(string errorMessage = null) { return NumberValue != 0 ? True : False; }
524529
public override Operand ToText(string errorMessage = null) { return Create(NumberValue.ToString(cultureInfo)); }
525530
public override Operand ToMyDate(string errorMessage = null) { return Create((MyDate)NumberValue); }

0 commit comments

Comments
 (0)