DecimalSymbol property (WinStudio scripts)

Applies To

IWSFormComponent interface

Definition

Sets or returns a character indicating the start of the fractional part of a decimal value of a component.

注意:This is useful when you need to change the character from the period used by some countries and the comma used by other countries.

Syntax

object.DecimalSymbol

  Part   Description
object Required. A reference to a form component object.

Remarks

This property corresponds to the decimal character setting in the numeric formatting of values of a component. In U.S. English, the value is normally a period (.).

Example

Sub Main()
   Dim strNewDecChar As String
   Dim iNewDigits As Integer
   Dim strCurrentDecChar As String
   Dim iCurrentDigits As Integer
   'Get current values of form variables
   strNewDecChar = ThisForm.Variables("DecimalChar").Value
   iNewDigits = ThisForm.Variables("DigitsAfterDecimal").GetValueOfInteger(0)
   'Get formatting values of "edit1" component
   strCurrentDecChar = ThisForm.Components("edit1").DecimalSymbol
   iCurrentDigits = ThisForm.Components("edit1").DigitsAfterDecimal
   Application.ShowMessage("Current decimal symbol = " & strCurrentDecChar & vbLf & _
      "Current digits after dec = " & iCurrentDigits.ToString() & vbLf & vbLf & _
      "New decimal symbol = " & strNewDecChar & vbLf & _
      "New digits after dec = " & iNewDigits.ToString())
   'Set formatting values of "Price" component to values of form variables
   ThisForm.Components("edit1").DecimalSymbol = strNewDecChar
   ThisForm.Components("edit1").DigitsAfterDecimal = iNewDigits
End Sub