FormatAmount

 

 

 

FormatAmount

 

Description

Formats any accounting amount or numeric value using a default or custom string.

 

Arguments

1.FormatAmount - Name of the Macro.

2.Value - The decimal value to be parsed and reformatted.  When used with Accounting Amounts a Debit value is parsed as positive and a Credit value is parsed as negative.

3.FormatString - A .NET format string used to transform the decimal value using number formats from the contextual culture settings.

 

Examples

[FormatAmount|100,000.00D]

This returns a positive value of 100,000.00 formatted as a general number.  With the en-US culture this would be output as 100000.0

 

[FormatAmount|100,000.00C]

This returns a negative value of 100,000.00 formatted as a general number.  With the en-US culture this would be output as -100000.0

 

[FormatAmount|[Copy|DestinationAmount]|#.00;(#.000);'']

This returns the destination amount formatted in different ways based on whether the value is positive, negative, or zero.

If the amount were 100.00D it would be formatted as 100.00

If the amount were 100.00C it would be formatted as (100.00)

If the amount were 0 a blank value would be returned.

 

[FormatAmount|100.00D|#.00;(#.000);0]

This returns the destination amount formatted in different ways based on whether the value is positive, negative, or zero.

 

Notes

For a complete list of formatting options see the Date and Time Format Strings topic elsewhere in help.

 


Copyright © 2024 pasUNITY, Inc.

 

Send comments on this topic.



Created with an evaluation copy of HelpSmith.
To remove this notice, you should purchase the full version of the product.