Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{description}
{excerpt}Creates a format string for displaying currency values.{excerpt}
{signature:C#}
 public System.String CreateCurrency(int numDecimalPlaces, boolean useDollarSign, boolean useNegativeSign, boolean useParensForNegatives, Color negativeColor)
{signature}{signature:vb.net}
Public Function CreateCurrency(ByVal numDecimalPlaces As Integer, ByVal useDollarSign As Boolean, ByVal useNegativeSign As Boolean, ByVal useParensForNegatives As Boolean, ByVal negativeColor As Color) As String
{signature}
{parameters}
{param:numDecimalPlaces}The number of decimal places to display.{param}
{param:useDollarSign}If {{true}}, the dollar sign will be displayed.{param}
{param:useNegativeSign}If {{true}}, the negative sign will be used for negative values.{param}
{param:useParensForNegatives}If {{true}}, negative numbers will be shown in parentheses.{param}
{param:negativeColor}A color to use when displaying negative numbers.  {{negativeColor}} may be null.{param}
{returns}A currency format string.{returns}
{example}{code:csharp|title=C#}

          //--- Create a style.
          Style styl = wb.CreateStyle();

          //--- The following assigns the currency string "$#,##0.00;[Red]-$#,##0.00"
          //--- to the style.
          styl.NumberFormat =
               wb.NumberFormat.CreateCurrency(2,
               true,
               true,
               false,
               NumberFormat.Color.Red);
        {code}
{code:vb.net|title=vb.net}

          '--- Create a style.
          Dim styl As Style = wb.CreateStyle()

          '--- The following assigns the currency string "$#,##0.00;[Red]-$#,##0.00"
          '--- to the style.
          styl.NumberFormat = wb.NumberFormat.CreateCurrency(2, _
               True, _
               True, _
               False, _
               NumberFormat.Color.Red)
        {code}

{example}