<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<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">
	<channel>
		<title>Gravity Support Forums Topic: Using Rounding for Calculations</title>
		<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations</link>
		<description>Gravity Support Forums Topic: Using Rounding for Calculations</description>
		<language>en-US</language>
		<pubDate>Sun, 05 Apr 2026 08:27:27 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/using-rounding-for-calculations" rel="self" type="application/rss+xml" />

		<item>
			<title>Sargent on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-58881</link>
			<pubDate>Mon, 14 May 2012 13:52:12 +0000</pubDate>
			<dc:creator>Sargent</dc:creator>
			<guid isPermaLink="false">58881@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Perfect, thank you!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-58354</link>
			<pubDate>Wed, 09 May 2012 12:40:21 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">58354@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello Gary,&#60;br /&#62;
Yes, you will need to use the gform_product_info hook (&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_product_info)&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_product_info)&#60;/a&#62;. Following is a code snippet to point you in the right direction.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_product_info&#38;quot;, &#38;quot;change_price&#38;quot;, 10, 3);
function change_price($product_info, $form, $lead){

	//NOTE: change this so that it loops through the products and finds the appropriate one
    $quantity = $product_info[&#38;quot;products&#38;quot;][1][&#38;quot;quantity&#38;quot;];
    if($quantity &#38;lt; 100)
        $product_info[&#38;quot;products&#38;quot;][1][&#38;quot;price&#38;quot;] = 40;

    return $product_info;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Sargent on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-58229</link>
			<pubDate>Tue, 08 May 2012 16:30:45 +0000</pubDate>
			<dc:creator>Sargent</dc:creator>
			<guid isPermaLink="false">58229@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Rob,&#60;/p&#62;
&#60;p&#62;Thank you for that hook the code now works on the front end of the site. However I am running into issues having the new total show up in notifications. Do I need to use the gform_product_info filter? If so I'm not understanding how it works. Here is the working Javascript code.&#60;/p&#62;
&#60;p&#62;function gform_product_total(formId, total){&#60;/p&#62;
&#60;p&#62;				standardrecord = jQuery(&#34;#input_2_14&#34;).val()*1;&#60;br /&#62;
				legalrecord = jQuery(&#34;#input_2_19&#34;).val()*2;&#60;br /&#62;
				quantity = (standardrecord + legalrecord);&#60;/p&#62;
&#60;p&#62;				if (quantity &#38;gt; 0) if (quantity &#38;lt;= 100)&#60;br /&#62;
				{&#60;br /&#62;
                return 40;&#60;br /&#62;
				}  }&#60;/p&#62;
&#60;p&#62;How would I write this same code so that it will show up in notifications?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rob Harrell on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-57671</link>
			<pubDate>Thu, 03 May 2012 17:14:59 +0000</pubDate>
			<dc:creator>Rob Harrell</dc:creator>
			<guid isPermaLink="false">57671@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This hook will solve for what you are trying to do.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_product_total&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_product_total&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Try it out and let us know if you run into any issues.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sargent on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-57661</link>
			<pubDate>Thu, 03 May 2012 16:53:22 +0000</pubDate>
			<dc:creator>Sargent</dc:creator>
			<guid isPermaLink="false">57661@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If this can't be done, let me explain what I'm trying to accomplish. We sell a certain service and when a user enters a quantity between 1-10 the price is X. If they enter between 11-20 the price is X+5. Anyone know if this is possible?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sargent on "Using Rounding for Calculations"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-rounding-for-calculations#post-57510</link>
			<pubDate>Wed, 02 May 2012 17:35:01 +0000</pubDate>
			<dc:creator>Sargent</dc:creator>
			<guid isPermaLink="false">57510@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there a way using the new Enable Calculations box to round to nearest variable number? For example the next increment of 10. So if someone were to enter the number 2 it would round to 10. We love the new features of GF, please let us know if this is possible. Thank you!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
