Reply To: Subtracting Percentage from Pricing Script

#95275
Peter Kahrel
Participant

> or should I leave one of the scripts set to 3 decimal places and use the GREP find/change to remove the 3rd number.

That’s the only way to go about it as far as i can see.

> I can do that, and I’ve tested it and it works so far, but it’s still another step (albeit faster than doing the pricing by hand).

It’s only a small step. You can save the GREP query (in the Find/Change window) for future use, or you can put it in a separate script:

app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences = ‘[$d,]+.ddKd+’;
app.documents[0].changeGrep();

There are many ways in which numbers can be finished. I’ve had requests for rounding everything up, rounding everything down, rounding up or down to the next 5 cents, not rounding. And your requirement is a bit different again. It’s not really possible to build all that into the script. Almost all these things can be handled by either a GREP query or a simple script.

P.

This article was last modified on June 9, 2017

Comments (0)

Loading comments...