<?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[QLCDNumber fixed width for numbers]]></title><description><![CDATA[<p dir="auto">Is there a possible solution to the following problem?</p>
<p dir="auto">I am using a QLCDNumber widget in Qt 3.3.4.<br />
I've set the widget to use 5 digits with setNumDigits(5).</p>
<p dir="auto">But the LCD doesn't print the numbers the way I would like to see them display.<br />
The idea is that the number 0.500 will be printed like 0.500, but the LCD prints: 0.5<br />
and, e.g. 1.460 is printed like 1.46 which should be printed as 1.460.</p>
<p dir="auto">I found the same problem in the old Qt interest archive, but didn't include an answer:<br />
<a href="http://lists.trolltech.com/qt-interest/2005-09/thread00018-0.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://lists.trolltech.com/qt-interest/2005-09/thread00018-0.html</a></p>
<p dir="auto">Are there are some ideas to solve this in a simple way? :)</p>
]]></description><link>https://forum.qt.io/topic/4473/qlcdnumber-fixed-width-for-numbers</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 02:14:28 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/4473.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Mar 2011 16:42:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QLCDNumber fixed width for numbers on Fri, 18 Mar 2011 17:35:35 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the tip!</p>
<p dir="auto">It works OK, I have used QString::sprintf() for formatting, and then transfered the QString to the QLCDNumber :)</p>
]]></description><link>https://forum.qt.io/post/80414</link><guid isPermaLink="true">https://forum.qt.io/post/80414</guid><dc:creator><![CDATA[BrainB0ne]]></dc:creator><pubDate>Fri, 18 Mar 2011 17:35:35 GMT</pubDate></item><item><title><![CDATA[Reply to QLCDNumber fixed width for numbers on Fri, 18 Mar 2011 16:58:26 GMT]]></title><description><![CDATA[<p dir="auto">I would format the number with "QString::arg() ":<a href="http://doc.qt.nokia.com/3.3/qstring.html#arg-a" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/3.3/qstring.html#arg-a</a> to a QString and set the display with "QLCDNumber::display() ":<a href="http://doc.qt.nokia.com/3.3/qlcdnumber.html#display" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/3.3/qlcdnumber.html#display</a> that takes a QString as argument.</p>
]]></description><link>https://forum.qt.io/post/80401</link><guid isPermaLink="true">https://forum.qt.io/post/80401</guid><dc:creator><![CDATA[goetz]]></dc:creator><pubDate>Fri, 18 Mar 2011 16:58:26 GMT</pubDate></item></channel></rss>