Class CalculatorValue
The Calculator Control uses this class to accept new values and also reports its internal value using this class.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class CalculatorValue
Remarks
This class encapsulates the value of the Calculator Control in the form that it maintains internally and also provides the value in the format required to the requesting class.
The CalculatorValue class provides methods to get the value of the Calculator Control as a string or as a double value.
The receiving method or class can get the value in the format they require it in and format it themselves for display.
This helps the Calculator Control to work with different kinds of classes that require the value to be formatted differently.
Constructors
CalculatorValue()
Initializes a new instance of the CalculatorValue class.
Declaration
public CalculatorValue()
Remarks
The CalculatorValue is initially set to zero. This can be changed by invoking the SetValue(Double) method.
CalculatorValue(Double)
Initializes a new instance of the CalculatorValue class.
Declaration
public CalculatorValue(double val)
Parameters
Type | Name | Description |
---|---|---|
System.Double | val | The initial value that is to be set. |
CalculatorValue(String)
Initializes a new instance of the CalculatorValue class.
Declaration
public CalculatorValue(string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | val | The initial value that is to be set. |
Properties
Empty
Gets a value for the CalculatorValue class.
Declaration
public static CalculatorValue Empty { get; }
Property Value
Type |
---|
CalculatorValue |
Remarks
This can be accessed as CalculatorValue.Empty.
NumberFormatInfoObject
Gets or sets System.Globalization.NumberFormatInfo provides the necessary globalization information for the properties that rely on these settings.
Declaration
public NumberFormatInfo NumberFormatInfoObject { get; set; }
Property Value
Type |
---|
System.Globalization.NumberFormatInfo |
Methods
SetValue(Double)
Sets the current value of the class object through a double value.
Declaration
public void SetValue(double val)
Parameters
Type | Name | Description |
---|---|---|
System.Double | val | The value that is to be set. |
Remarks
Invoke this method to set the value of the CalculatorValue object using a double.
SetValue(String)
Sets the current value of the class object through a string.
Declaration
public void SetValue(string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | val | The value that is to be set. |
Remarks
Invoke this method to set the value of the CalculatorValue object using a string.
ToDecimal()
Returns the current value of the class object as a decimal type.
Declaration
public decimal ToDecimal()
Returns
Type | Description |
---|---|
System.Decimal | Returns decimal value |
Remarks
Invoke this method to get the value of the CalculatorValue object as a decimal.
ToDouble()
Returns the current value of the class object as a double type.
Declaration
public double ToDouble()
Returns
Type | Description |
---|---|
System.Double | returns double value |
Remarks
Invoke this method to get the value of the CalculatorValue object as a double.
ToString()
Returns the current value of the class object as a string type.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Returns string value |
Overrides
Remarks
Invoke this method to get the value of the CalculatorValue object as a string.