Skip to main content

Is there a formatting code that will decimal align numbers so that the decimal is aligned for both positive & negative numbers when you use brackets for negative numbers?  

Acumatica does this:

  1,000.00
(1,000.00)

instead of this

 1,000.00
(1,000.00)

TIA

Hi @RHarrison 

I just came up with a way to use the IIF Function to do it as the following example.

=IIf( SOLine.CuryLineAmt] < 0
    , '(' + Abs(ASOLine.CuryLineAmt]) + ')'
    , ÂSOLine.CuryLineAmt] )

 

 

Best Regards,

NNT


@nhatnghetinh - This doesn't solve the question. It's a spacing problem, not a formatting problem (although it's not super clear because of the way the post is formatted)

Acumatica does this:

   1,000.00
(1,000.00)

instead of this

 1,000.00
(1,000.00)

 

However, you could use an IIf statement to pad the non-negative numbers with a space.


@RHarrison Did you get this resolved?


@RHarrison Did you get this resolved?

Nope.  I’ve tried formatting like this #,###.00;(#,###.00) but that gives me the out of alignment result.  I can’t figure out want to put before the semicolon to give me a space after the positive number.  I’m guessing there might be an ascii code to represent a hard space but I haven’t looked that up yet.  I’m also not sure out to enter it in the report writer.

Any suggestions?


You may have a couple options. You can try using a non-space whitespace character. There are quite a few described in this post. You can use the Character Map program that ships with Windows to find them by their Unicode number:

 

I would just paste them into the format line and see if they stick. If not, you can go the route of manually formatting them with either the Format function (ie =Format()) or using an IIF.

Let me know how it goes or if you have any questions.


You may have a couple options. You can try using a non-space whitespace character. There are quite a few described in this post. You can use the Character Map program that ships with Windows to find them by their Unicode number:

 

I would just paste them into the format line and see if they stick. If not, you can go the route of manually formatting them with either the Format function (ie =Format()) or using an IIF.

Let me know how it goes or if you have any questions.

Tried them all.  Not only did they not work, but they caused the report to error out.  If I try to validate the field once pasting in any of these codes, the validation fails.

I’m going to keep trying though.


Hi @RHarrison Try the formula with a space as below and let us know your feedback.

=IIf( SOLine.CuryLineAmt] < 0
    , ' (' + Abs(ASOLine.CuryLineAmt]) + ')'
    , ÂSOLine.CuryLineAmt] )


Hi @RHarrison To be more clear, please note the space added(Highlghted in yellow) as below in the formula:
 

 


@ChandraM - If I’m not mistaken, you’d want the space on the right-hand side of positive values. The values are right-aligned.


Hi @darylbowman Thanks for the update. Wonderful!

@RHarrison  So the revised formula will be as shown below:

=IIf( (SOLine.CuryLineAmt] < 0
    , '(' + Abs( SOLine.CuryLineAmt]) + ') '
    ,  SOLine.CuryLineAmt])
 

 


...right-hand side of positive values...

Something like this:

=IIf([SOLine.CuryLineAmt]>=0,Format('{0:#,##0.00} ',[SOLine.CuryLineAmt]),Format('({0:#,##0.00})',Abs([SOLine.CuryLineAmt])))

 


Reply