VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />
FormatCurrency<br />
Description Formats an expression as a currency value using the currency symbol defined in the system<br />
control panel.<br />
Usage curValue = FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit<br />
[,UseParensForNegativeNumbers [,GroupDigits]]]])<br />
Arguments Expression<br />
Required. Any valid expression to be <strong>for</strong>matted.<br />
NumDigitsAfterDecimal<br />
Optional. Numeric value indicating how many places to the right of the decimal are displayed.<br />
Default value is -1, which indicates that the computer's regional settings are used.<br />
IncludeLeadingDigit<br />
Optional. Tristate constant that indicates whether or not a leading zero is displayed <strong>for</strong><br />
fractional values. See Settings section <strong>for</strong> values. Can use one of the following constants:<br />
vbUseDefault 2 Uses settings from the Number tab in Control Panel<br />
vbTrue -1<br />
vbFalse 0<br />
UseParensForNegativeNumbers<br />
Optional. Tristate constant that indicates whether or not to place negative values within<br />
parentheses. Can use one of the following constants:<br />
vbUseDefault 2 Uses settings from the Number tab in Control Panel<br />
vbTrue -1<br />
vbFalse 0<br />
GroupDigits<br />
Optional. Tristate constant that indicates whether or not numbers are grouped using the<br />
group delimiter specified in the computer's regional settings. Can use one of the following<br />
constants:<br />
vbUseDefault 2 Uses settings from the Number tab in Control Panel<br />
vbTrue -1<br />
vbFalse 0<br />
Settings The IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits arguments have the<br />
following settings:<br />
Constant Value Description<br />
TristateTrue -1 True<br />
TristateFalse 0 False<br />
TristateUseDefault -2 Use the setting from the computer’s regional settings<br />
Return Returns Currency value<br />
Remarks When one or more optional arguments are omitted, values <strong>for</strong> omitted arguments are provided by<br />
the computer's regional settings. The position of the currency symbol relative to the currency<br />
value is determined by the system's regional settings.<br />
All settings in<strong>for</strong>mation comes from the Regional Settings Currency tab, except leading zero,<br />
which comes from the Number tab.<br />
See also FormatDateTime, FormatNumber, FormatPercent<br />
Example Dim MyCurrency<br />
MsgBox FormatCurrency(1000,2) ' Displays $1,000.00<br />
MyCurrency = FormatCurrency(1000,2) ‘ MyCurrency contains “$1,000.00”<br />
132 <strong>InduSoft</strong>, Ltd.