<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Free Script to Change All Numbers in a Document using Math</title>
	<atom:link href="http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/feed" rel="self" type="application/rss+xml" />
	<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php</link>
	<description>InDesignSecrets Blog and Podcast</description>
	<lastBuildDate>Wed, 23 May 2012 23:34:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Roberto</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-493063</link>
		<dc:creator>Roberto</dc:creator>
		<pubDate>Mon, 17 Oct 2011 16:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-493063</guid>
		<description>Can anyone help me? 
I need to modify all the prices on the pricelist of my company, the problem is the format is either 1.200 (meaning 1200 €) or 430 (430 €)
I need to add 4% to all the prices.
I tried successfully to modifiy all the numbers *.*** using the regex system but only to add or multiply for natural numbers, I can&#039;t multiply for 1,04 with this script.

At the same time I need to mantain all the codes, for example 45.48.86 so I&#039;d need to add an exception for this configuration of numbers, but not for the two digits one by themselves.

In some places there are number like 100 that need to stay the same, usually the line is &quot;O100&quot; or &quot;O 100&quot; (it means the diameter is 100mm). If anyone can help with these, as it&#039;ll take a life to modify all the prices manually!!

1.000 need to become 1.040
100-&gt;104
O100 or O 100 stays the same
34.56.32 stays the same
When the number have decimals it need to round up for excess...</description>
		<content:encoded><![CDATA[<p>Can anyone help me?<br />
I need to modify all the prices on the pricelist of my company, the problem is the format is either 1.200 (meaning 1200 €) or 430 (430 €)<br />
I need to add 4% to all the prices.<br />
I tried successfully to modifiy all the numbers *.*** using the regex system but only to add or multiply for natural numbers, I can&#8217;t multiply for 1,04 with this script.</p>
<p>At the same time I need to mantain all the codes, for example 45.48.86 so I&#8217;d need to add an exception for this configuration of numbers, but not for the two digits one by themselves.</p>
<p>In some places there are number like 100 that need to stay the same, usually the line is &#8220;O100&#8243; or &#8220;O 100&#8243; (it means the diameter is 100mm). If anyone can help with these, as it&#8217;ll take a life to modify all the prices manually!!</p>
<p>1.000 need to become 1.040<br />
100-&gt;104<br />
O100 or O 100 stays the same<br />
34.56.32 stays the same<br />
When the number have decimals it need to round up for excess&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: top</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-490868</link>
		<dc:creator>top</dc:creator>
		<pubDate>Thu, 12 May 2011 07:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-490868</guid>
		<description>Thank you, it very comfortable!</description>
		<content:encoded><![CDATA[<p>Thank you, it very comfortable!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hassen</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-490725</link>
		<dc:creator>hassen</dc:creator>
		<pubDate>Tue, 03 May 2011 10:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-490725</guid>
		<description>I installed your script in indesign cs4
but your script does not work with the comma,
thank you for finding a solution.
Thanks.
Hassen</description>
		<content:encoded><![CDATA[<p>I installed your script in indesign cs4<br />
but your script does not work with the comma,<br />
thank you for finding a solution.<br />
Thanks.<br />
Hassen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tara</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-490292</link>
		<dc:creator>Tara</dc:creator>
		<pubDate>Fri, 08 Apr 2011 01:14:12 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-490292</guid>
		<description>I install the script into CS3, but it won&#039;t run and I desperately need this to work. What am I doing wrong?

Thanks.

Tara</description>
		<content:encoded><![CDATA[<p>I install the script into CS3, but it won&#8217;t run and I desperately need this to work. What am I doing wrong?</p>
<p>Thanks.</p>
<p>Tara</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Blatner</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-490108</link>
		<dc:creator>David Blatner</dc:creator>
		<pubDate>Thu, 31 Mar 2011 22:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-490108</guid>
		<description>@JP: Not sure what you mean. Javascripts work on both mac and windows versions of InDesign.</description>
		<content:encoded><![CDATA[<p>@JP: Not sure what you mean. Javascripts work on both mac and windows versions of InDesign.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-490107</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Thu, 31 Mar 2011 22:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-490107</guid>
		<description>Do you have this for Mac?</description>
		<content:encoded><![CDATA[<p>Do you have this for Mac?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mick</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-487777</link>
		<dc:creator>Mick</dc:creator>
		<pubDate>Thu, 13 Jan 2011 14:12:15 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-487777</guid>
		<description>I got a syntax error on this line

for (var i = 0; i &lt; myRoundto – my_postComma.length; i++)

Should be 
for (var i = 0; i &lt; myRoundto - my_postComma.length; i++)

It was fine for making 3.5 up to 3.50, but 3.00 still came out as 3 so I have added these lines

if (dec_index != -2)
{
var my_postComma = myRoundedNum.substring(dec_index +1,myRoundedNum.length);
for (var i = 0; i &lt; myRoundto - my_postComma.length; i++)
myRoundedNum += &#039;.00&#039;;
}

Works okay now, but I&#039;d like the &quot;Only accept numbers with prefix ...&quot; nox to accept a tab , as well as a currrency symbol.
Can this be done?</description>
		<content:encoded><![CDATA[<p>I got a syntax error on this line</p>
<p>for (var i = 0; i &lt; myRoundto – my_postComma.length; i++)</p>
<p>Should be<br />
for (var i = 0; i &lt; myRoundto &#8211; my_postComma.length; i++)</p>
<p>It was fine for making 3.5 up to 3.50, but 3.00 still came out as 3 so I have added these lines</p>
<p>if (dec_index != -2)<br />
{<br />
var my_postComma = myRoundedNum.substring(dec_index +1,myRoundedNum.length);<br />
for (var i = 0; i &lt; myRoundto &#8211; my_postComma.length; i++)<br />
myRoundedNum += &#039;.00&#039;;<br />
}</p>
<p>Works okay now, but I&#039;d like the &quot;Only accept numbers with prefix &#8230;&quot; nox to accept a tab , as well as a currrency symbol.<br />
Can this be done?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carola</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-487711</link>
		<dc:creator>carola</dc:creator>
		<pubDate>Tue, 11 Jan 2011 15:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-487711</guid>
		<description>have you any idea, how it could work with CS2?
I´m not to sophisticated nor in my english nor in scripts - but i have to get it work ...

best wishes 
Carola</description>
		<content:encoded><![CDATA[<p>have you any idea, how it could work with CS2?<br />
I´m not to sophisticated nor in my english nor in scripts &#8211; but i have to get it work &#8230;</p>
<p>best wishes<br />
Carola</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Marken</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-2#comment-483858</link>
		<dc:creator>Jon Marken</dc:creator>
		<pubDate>Tue, 15 Jun 2010 20:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-483858</guid>
		<description>Wow, this works great. A client produced his own index and we had to add two pages to the beginning of the book. This made the changes very easy. Second time David Blatner saved my skin. Thanks!</description>
		<content:encoded><![CDATA[<p>Wow, this works great. A client produced his own index and we had to add two pages to the beginning of the book. This made the changes very easy. Second time David Blatner saved my skin. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Fischer</title>
		<link>http://indesignsecrets.com/free-script-to-change-all-numbers-in-a-document-using-math.php/comment-page-1#comment-482276</link>
		<dc:creator>Martin Fischer</dc:creator>
		<pubDate>Wed, 31 Mar 2010 23:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/?p=2553#comment-482276</guid>
		<description>@Jongware

&gt; In case it isn’t fixed as yet, trailing zeroes can be preserved as follows.

Just replace the numRounder-function with the function below:


function numRounder(myNumber, myRoundto)
{
	myRoundMod = 1;
	for(rounding = 0; rounding &lt; myRoundto; rounding++)	
	{
		myRoundMod = myRoundMod * 10;	
	}
	myRoundedNum = String(Math.round(myNumber*myRoundMod)/myRoundMod);
	var dec_index = myRoundedNum.indexOf(&#039;.&#039;);
	if (dec_index != -1)
	{
		var my_postComma = myRoundedNum.substring(dec_index +1,myRoundedNum.length);
		for (var i = 0; i &lt; myRoundto - my_postComma.length; i++)
		myRoundedNum += &#039;0&#039;;
	}
	return myRoundedNum;
}


Best wishes
Martin</description>
		<content:encoded><![CDATA[<p>@Jongware</p>
<p>&gt; In case it isn’t fixed as yet, trailing zeroes can be preserved as follows.</p>
<p>Just replace the numRounder-function with the function below:</p>
<p>function numRounder(myNumber, myRoundto)<br />
{<br />
	myRoundMod = 1;<br />
	for(rounding = 0; rounding &lt; myRoundto; rounding++)<br />
	{<br />
		myRoundMod = myRoundMod * 10;<br />
	}<br />
	myRoundedNum = String(Math.round(myNumber*myRoundMod)/myRoundMod);<br />
	var dec_index = myRoundedNum.indexOf(&#039;.&#039;);<br />
	if (dec_index != -1)<br />
	{<br />
		var my_postComma = myRoundedNum.substring(dec_index +1,myRoundedNum.length);<br />
		for (var i = 0; i &lt; myRoundto &#8211; my_postComma.length; i++)<br />
		myRoundedNum += &#039;0&#039;;<br />
	}<br />
	return myRoundedNum;<br />
}</p>
<p>Best wishes<br />
Martin</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching using disk

Served from: indesignsecrets.com @ 2012-05-24 01:00:46 -->
