<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Metric to Imperial Calculation in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503252#M25346</link>
    <description>&lt;P&gt;I've have some data in HubDB that represents a metric measuremnt in mm for example 3174. A calculation then converts it to feet and inches;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set metric = (row.gf_kitchen_met_1) %}
{% set imperial = 304.8 %} 
{% set calculation = (metric / imperial ) | round (1, 'floor') %}

Original = {{row["gf_kitchen_met_1"]}}&amp;lt;br&amp;gt;
Converted = {{ calculation }}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example above correctly shows&amp;nbsp;&amp;nbsp;3174 converted to 10.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to show the converted number with the correct symbols, i.e. &lt;STRONG&gt;10'4"&lt;/STRONG&gt;&amp;nbsp; ?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 10:30:07 GMT</pubDate>
    <dc:creator>ben-duchy</dc:creator>
    <dc:date>2021-09-30T10:30:07Z</dc:date>
    <item>
      <title>Metric to Imperial Calculation</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503252#M25346</link>
      <description>&lt;P&gt;I've have some data in HubDB that represents a metric measuremnt in mm for example 3174. A calculation then converts it to feet and inches;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set metric = (row.gf_kitchen_met_1) %}
{% set imperial = 304.8 %} 
{% set calculation = (metric / imperial ) | round (1, 'floor') %}

Original = {{row["gf_kitchen_met_1"]}}&amp;lt;br&amp;gt;
Converted = {{ calculation }}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example above correctly shows&amp;nbsp;&amp;nbsp;3174 converted to 10.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to show the converted number with the correct symbols, i.e. &lt;STRONG&gt;10'4"&lt;/STRONG&gt;&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 10:30:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503252#M25346</guid>
      <dc:creator>ben-duchy</dc:creator>
      <dc:date>2021-09-30T10:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Metric to Imperial Calculation</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503257#M25348</link>
      <description>&lt;P&gt;I figured it out&amp;nbsp;using the 'replace' function&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New calculation = {{ calculation|replace('.','&amp;amp;apos;') }}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 10:41:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503257#M25348</guid>
      <dc:creator>ben-duchy</dc:creator>
      <dc:date>2021-09-30T10:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Metric to Imperial Calculation</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503366#M25354</link>
      <description>&lt;P&gt;Solved in 11 minutes from initial post to answering yourself.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":motorcycle:"&gt;🏍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 13:24:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503366#M25354</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-09-30T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Metric to Imperial Calculation</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503463#M25358</link>
      <description>&lt;P&gt;Well sort of&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;. I've had another look at the above and it's only caluclating the 'ft' not inches. Howver using the below is a lot more&amp;nbsp;accurate...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% for row in housetype_db %}
  &amp;lt;!-- Convert mm to ft &amp;amp; inches --&amp;gt;
  {% set inches = (row.gf_kitchen_met_1 / 25.4) %}
  {% set feet = (inches / 12)|round(0, 'floor') %}
  {% set measurement = (inches % 12)|round(0) %}
  &amp;lt;!-- Run calculation --&amp;gt;
  {% if measurement &amp;gt;= 12 %}
    &amp;lt;p&amp;gt;{{ feet + 1 }}'0"&amp;lt;/p&amp;gt;
  {% else %}
    &amp;lt;p&amp;gt;{{ feet }}'{{ measurement }}"&amp;lt;/p&amp;gt;
  {% endif %}
{% endfor %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 15:31:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Metric-to-Imperial-Calculation/m-p/503463#M25358</guid>
      <dc:creator>ben-duchy</dc:creator>
      <dc:date>2021-09-30T15:31:28Z</dc:date>
    </item>
  </channel>
</rss>

