|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
is there a way to write a rule that will add parentheses to financial data instead of the (-)negative? I know excel has the formula, but it is lost in .csv file
I see the Negative as Red rule, but that's not what they want. Wondering if anyone has already figured this out. any help is appreciated. Thanks |
|
#2
|
||||
|
||||
|
Assuming your data includes the minus sign (-) at the beginning of negative values, would the following work?
Code:
return (Field("Amount").search(/-/)==0) ? "(" + Field("Amount").replace("-","") + ")" : Field("Amount");
__________________
Eric Smith Prepress Guru Classic Graphics FP 6.0P1f, MAC OSX 10.5.7, Acrobat 9.1.3 |
|
#3
|
|||
|
|||
|
Eureka!!
You are the Guru! It worked great.I got it to work, but I have several FIELDS to apply the rule to. I would like to have one rule ["to rule them all..."] that contains the definition for 12 fields ... do I need to create one rule for each FIELD, or do you have more magic to share. Thanks so much. jbq |
|
#4
|
||||
|
||||
|
You can either create a separate rule for each field (duplicate rule and update field info) or create a FOR loop to cycle through all fields in one rule (may have to create an array from all the data first). If you choose the latter, the "rule creator" would need to know how the result needs to be formatted first (space/tab/line break between results?).
__________________
Eric Smith Prepress Guru Classic Graphics FP 6.0P1f, MAC OSX 10.5.7, Acrobat 9.1.3 |
![]() |
| Tags |
| rules |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|