Price adjuster

There are two scripts (that I'm aware of) that can be used to adjust numbers and prices: Olav Kvern's 'PriceUpdateByString' script and Steve Wareham's 'number_adjuster'. Ole's script was written for InDesign CS2 and isn't compatible with newer versions of InDesign, and Steve's scripts needed some attention to rounding of numbers. Since both scripts needed some attention and as they largely complemented each other (there was only little overlap), the logical thing to do was to write a new script that combined the functionality of both scripts. Ole gave permission to repurpose any of his code, but Steve could not be found and his web site appears to have gone permanently off-line.

Use

The script shows this dialog:

Price adjuster

Operation Options are Multiply, Divide, Add, and Subtract.

Operator Enter the operator. To multiply all prices by 2, enter 2. Ole's script had the possibility to add or subtract a percentage to prices, which can be done with this script too: multiply prices by 1.18 to add 18% to all prices; multiply by 1-18 to subtract 18%. You can use . or , for decimals.

Currency symbol Options are £, , $, ¥, ¤, , Any, and None. 'Any' matches any and all prices, 'None' ignores currency symbols so that the script in effect becomes a general number adjuster. If you include a currency symbol, a space after the symbol is ignored.

Replacement currency symbol The currency symbol selected here replaces the symbol selected at Currency symbol, and the script becomes a currency converter. Select [Ignore] to keep the original currency symbol.

Separator Select a separator to be added between the currency symbol and money amount. Options are [None], Fixed space, Third space, Quarter space, Sixth space, Thin space, and Hair space.

Number format Choose 1,234.56 or 1.234,56. The script really only needs to know the decimal character. It finds numbers with and without thousands separators.

Insert thousands separator Indicate whether thousands separators should be used in the adjusted numbers.

Number of decimals Select the number of decimals to be used.

Apply colour Another feature from Ole's script which appeared to be popular. It makes checking the results easy. It's best to create a separate swatch so that you can remove the colour easily. Select [Ignore] if you don't want to apply a colour.

Target Select the target (Document, Story, To end of story, or Selection).

Target character style Limit the script's operation to a certain character style. This works the same as using character styles in InDesign's Find/Change panel.


Version history

7 March 2023: Following a suggestion of a user I added an option, 'Replacement currency symbol'. This is useful when currencies need to be converted.

29 Dec. 2012: Changed the behaviour of '0 decimals': when you select this, numbers are rounded up to the nearest integer.

4 Feb. 2016: Added the option to limit the search to a character style.

8 Sept. 2015: Fixed a problem with the $ symbol so that US dollar prices are processed correctly.

15 August 2015: Posted.


Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Show script (right click, Save Link/Target As to download)

Back to script index

Installing and running scripts

Questions, comments? Get in touch