<?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 Why does Databricks SQL drop ending 0 in decimal data type in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25498#M17738</link>
    <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column, RateAdj that is defined as DECIMAL(15,5) and I can see that the value is 4.00000, but when this gets inserted into my table it shows as just 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%sql
&amp;nbsp;
SELECT LTRIM(RTRIM(IFNULL(FORMAT_NUMBER(RateADJ, '0.00000'), '0.00000')))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is a small example of this.  Other columns are set the same, when SELECTing them, they could show as 152.32140 but when this gets inserted it is just 152.3214.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am needing the 0's to hang around after they are inserted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is causing the ending 0's to drop off when getting inserted into the table?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 14:26:55 GMT</pubDate>
    <dc:creator>gbradley145</dc:creator>
    <dc:date>2022-10-27T14:26:55Z</dc:date>
    <item>
      <title>Why does Databricks SQL drop ending 0 in decimal data type</title>
      <link>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25498#M17738</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column, RateAdj that is defined as DECIMAL(15,5) and I can see that the value is 4.00000, but when this gets inserted into my table it shows as just 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%sql
&amp;nbsp;
SELECT LTRIM(RTRIM(IFNULL(FORMAT_NUMBER(RateADJ, '0.00000'), '0.00000')))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is a small example of this.  Other columns are set the same, when SELECTing them, they could show as 152.32140 but when this gets inserted it is just 152.3214.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am needing the 0's to hang around after they are inserted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is causing the ending 0's to drop off when getting inserted into the table?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 14:26:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25498#M17738</guid>
      <dc:creator>gbradley145</dc:creator>
      <dc:date>2022-10-27T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does Databricks SQL drop ending 0 in decimal data type</title>
      <link>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25499#M17739</link>
      <description>&lt;P&gt;Hi @Greg Bradley​&amp;nbsp;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try casting your value to decimal before writing it ?&lt;/P&gt;&lt;P&gt;Ideally casting the value as decimal should preserve it's precision if defined. &lt;/P&gt;&lt;P&gt;Attaching a screenshot for the same. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1300i429BCA661AE55268/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;Do reply if any other help is needed...Cheers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 13:19:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25499#M17739</guid>
      <dc:creator>UmaMahesh1</dc:creator>
      <dc:date>2022-11-23T13:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does Databricks SQL drop ending 0 in decimal data type</title>
      <link>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25500#M17740</link>
      <description>&lt;P&gt;Hi @Greg Bradley​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope everything is going great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking in. If @Uma Maheswara Rao Desula​&amp;nbsp; answer helped, would you let us know and mark the answer as best? If not, would you be happy to give us more information?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 06:15:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-does-databricks-sql-drop-ending-0-in-decimal-data-type/m-p/25500#M17740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-05T06:15:27Z</dc:date>
    </item>
  </channel>
</rss>

