Format Negative numbers in parenthesis BUT NOT with $ symbol?

前端 未结 2 523
心在旅途
心在旅途 2020-12-14 16:32

I have seen all over the internet to format a NEGATIVE double value with a parenthesis WITH a $ symbol ie. currency type.

I am looking for a .NET format

2条回答
  •  独厮守ぢ
    2020-12-14 16:59

    You can use the FormatNumber function:

    FormatNumber(-100, UseParensForNegativeNumbers:=TriState.True)

    will return "(100)"

    There's more on MSDN

提交回复
热议问题