<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Int to Float conversion]]></title><description><![CDATA[<p dir="auto">Hello, how can I convert an int value (10000 mV) from a variable to a float value in a Label block (10,000 V) ?<br />
Thank you all for the help</p>
]]></description><link>https://community.m5stack.com/topic/5253/int-to-float-conversion</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 06:20:39 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5253.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Apr 2023 07:25:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Int to Float conversion on Sun, 30 Apr 2023 19:50:18 GMT]]></title><description><![CDATA[<p dir="auto">Use the math function block to convert in to float then use a text block to convert to string?</p>
]]></description><link>https://community.m5stack.com/post/20716</link><guid isPermaLink="true">https://community.m5stack.com/post/20716</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 30 Apr 2023 19:50:18 GMT</pubDate></item><item><title><![CDATA[Reply to Int to Float conversion on Sat, 29 Apr 2023 17:40:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cognitive5525" aria-label="Profile: cognitive5525">@<bdi>cognitive5525</bdi></a> said in <a href="/post/20706">Int to Float conversion</a>:</p>
<blockquote>
<p dir="auto">A4 = int(A3, 16)<br />
A5 = A3 /1000<br />
label0.setText(str(A5))</p>
</blockquote>
<p dir="auto">Thank you!</p>
<p dir="auto">solved with this code:</p>
<p dir="auto">A4 = int(A3, 16)<br />
A5 = A4 /1000<br />
label0.setText(str(A5))</p>
]]></description><link>https://community.m5stack.com/post/20710</link><guid isPermaLink="true">https://community.m5stack.com/post/20710</guid><dc:creator><![CDATA[elettronico]]></dc:creator><pubDate>Sat, 29 Apr 2023 17:40:44 GMT</pubDate></item><item><title><![CDATA[Reply to Int to Float conversion on Fri, 28 Apr 2023 21:46:18 GMT]]></title><description><![CDATA[<p dir="auto">I'm not sure what A3 becomes since I can't see what A1 and A2 are, but:</p>
<blockquote>
<p dir="auto">A4 = (str(int(A3, 16)))</p>
</blockquote>
<p dir="auto">makes A4 a string which you can't do arithmetic on.</p>
<p dir="auto">Provided that A3 can be converted to an integer, I would:</p>
<blockquote>
<p dir="auto">A4 = int(A3, 16)<br />
A5 = A3 /1000<br />
label0.setText(str(A5))</p>
</blockquote>
]]></description><link>https://community.m5stack.com/post/20706</link><guid isPermaLink="true">https://community.m5stack.com/post/20706</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Fri, 28 Apr 2023 21:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to Int to Float conversion on Fri, 28 Apr 2023 18:56:58 GMT]]></title><description><![CDATA[<p dir="auto">thank you Cognitive5525, I have already tried but it does not work.</p>
<p dir="auto">Here is the partial code:</p>
<pre><code>  A3 = (str((hex(A2)[2:] + hex(A1)[2:])))
  A4 = (str(int(A3, 16))) // here all ok and the Label shows 10000 mV
  A5 = A4 / 1000
  label0.setText(str(A5)) //the label shows nothing
</code></pre>
]]></description><link>https://community.m5stack.com/post/20705</link><guid isPermaLink="true">https://community.m5stack.com/post/20705</guid><dc:creator><![CDATA[elettronico]]></dc:creator><pubDate>Fri, 28 Apr 2023 18:56:58 GMT</pubDate></item><item><title><![CDATA[Reply to Int to Float conversion on Fri, 28 Apr 2023 14:39:32 GMT]]></title><description><![CDATA[<p dir="auto">Since you posted under  UIFlow, then that is what you use I suppose:<br />
<img src="/assets/uploads/files/1682692751478-c177659d-a376-4ab0-9568-04487becf4bd-image.png" alt="0_1682692755877_c177659d-a376-4ab0-9568-04487becf4bd-image.png" class=" img-fluid img-markdown" /><br />
which results in the following Python code:</p>
<p dir="auto">my_val = my_val / 1000</p>
]]></description><link>https://community.m5stack.com/post/20704</link><guid isPermaLink="true">https://community.m5stack.com/post/20704</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Fri, 28 Apr 2023 14:39:32 GMT</pubDate></item><item><title><![CDATA[Reply to Int to Float conversion on Fri, 28 Apr 2023 14:40:10 GMT]]></title><description><![CDATA[<p dir="auto">What language?</p>
<p dir="auto">In Python you can simply:</p>
<p dir="auto">my_val = 10000<br />
my_val = my_val/1000</p>
]]></description><link>https://community.m5stack.com/post/20703</link><guid isPermaLink="true">https://community.m5stack.com/post/20703</guid><dc:creator><![CDATA[Cognitive5525]]></dc:creator><pubDate>Fri, 28 Apr 2023 14:40:10 GMT</pubDate></item></channel></rss>