FormatCurrency

Format a number with a currency symbol.

Syntax 
      FormatCurrency(number [,DecimalPlaces [,IncludeLeadingZero
          [,UseParenthesis [, GroupDigits]]]] )

Key
   number              The number to format.
 
   DecimalPlaces       Number of digits to display after the decimal point.

   IncludeLeadingZero  Include a leading zero for numbers <1 and > -1

   UseParenthesis      Show negative numbers in Parentheis (500) = -500

   GroupDigits         Group large numbers with commas (or the regional delimiter)

Example

Set intDemo = 150000.56
WScript.Echo FormatCurrency(intDemo,1)

“The best way to destroy the capitalist system is to debauch the currency. By a continuing process of inflation, governments can confiscate, secretly and unobserved, an important part of the wealth of their citizens” ~ John Maynard Keynes

Related:

FormatNumber - Format a number.
FormatPercent - Format a number with a % symbol.
FormatDateTime - Format a Date/Time value.
Equivalent PowerShell:
$myvar = "{0:C}" -f 1500 will display $1500


 
Copyright © 1999-2021 SS64.com
Some rights reserved