<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>I need some help with doing some calculations using the values from two different records. </title>
        <link>https://interactivetools.com/forum/forum-posts.php?I-need-some-help-with-doing-some-calculations-using-the-values-from-two-different-records_-83003</link>
        <description></description>
        <pubDate>Wed, 18 Nov 2026 20:21:52 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;I-need-some-help-with-doing-some-calculations-using-the-values-from-two-different-records_-83003" rel="self" type="application/rss+xml" />

                <item>
          <title>I need some help with doing some calculations using the values from two different records. </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247905#post2247905</link>
          <description><![CDATA[<p>Thank you so much!! That worked perfectly. You're a lifesaver! I added the round function as well.</p>
<p>Have a great day!</p>
<p>Kevin</p>]]></description>
          <pubDate>Thu, 20 Mar 2025 09:47:19 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247905#post2247905</guid>
        </item>
                <item>
          <title>I need some help with doing some calculations using the values from two different records. </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247904#post2247904</link>
          <description><![CDATA[<p>Hello kevbarker,</p>
<p>I believe replacing your calculation table cell with the following should do the trick. I am assuming you just need it for the display and not in the database. </p>
<pre class="language-php"><code>&lt;td align="center"&gt;&lt;?php echo htmlencode( (intval($record['total_live_hatchlings']) / intval($record['total_number_of_eggs'])) * 100 ) ?&gt;&lt;/td&gt;</code></pre>
<p>So here we are taking each record column, converting them to integers, divide the total hatchlings by the number of eggs and multiply by 100. That will give you a floating point value. If you need to round it, there is the PHP round function you can use to do that as well. </p>
<p>Hopefully this is what you were looking to do.</p>]]></description>
          <pubDate>Thu, 20 Mar 2025 09:15:30 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247904#post2247904</guid>
        </item>
                <item>
          <title>I need some help with doing some calculations using the values from two different records. </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247903#post2247903</link>
          <description><![CDATA[<p>I need some help with doing some calculations using the values from two different records. The site is for a sea turtle patrol and we have a table of statistics showing how many turtle nests, total turtle eggs, and how many l<span>ive turtle h</span><span>atchlings from those eggs. There is a column which displays the value for percentage of live hatchlings. In order to get that value I need to divide live turtle hatchlings by total turtle eggs then multiply * 100. The percentage field is currently calculated and entered manually. I would like to automate this process and have it done using php, as the records are generated/being displayed in the page. (See attached screenshot of the table and data displayed)</span></p>
<p>Here is the working code which populates the table: </p>
<p>&lt;?php foreach ($annual_statistics_dataRecords as $record): ?&gt;<br />&lt;tr&gt;<br />&lt;td class="boldText" align="center"&gt;&lt;?php echo htmlencode($record['data_year']) ?&gt;&lt;/td&gt;<br />&lt;td align="center"&gt;&amp;nbsp;&lt;/td&gt;<br />&lt;td align="center"&gt;&lt;?php echo htmlencode($record['total_number_of_nests']) ?&gt;&lt;/td&gt;<br />&lt;td align="center"&gt;&lt;?php echo htmlencode($record['total_number_of_eggs']) ?&gt;&lt;/td&gt;<br />&lt;td align="center"&gt;&lt;?php echo htmlencode($record['total_live_hatchlings']) ?&gt;&lt;/td&gt;<br />&lt;td align="center"&gt;&lt;?php echo htmlencode($record['percentage_of_live_hatchlings']) ?&gt;&lt;/td&gt;<br />&lt;/tr&gt;<br />&lt;?php endforeach ?&gt;</p>
<p>So I need to take ($record['total_live_hatchlings']) and divide that by ($record['total_number_of_eggs']) then multiply by 100 and then display that value instead of the (manually entered) ($record['percentage_of_live_hatchlings'])</p>
<p>Hopefully this all makes sense. Anyone know how to accomplish this</p>
<p>Thanks in advance for any help!</p>]]></description>
          <pubDate>Thu, 20 Mar 2025 06:06:11 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247903#post2247903</guid>
        </item>
              </channel>
    </rss>
  