<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Lazarus - Format Integer or Int64 with thousands separator - Delphi, Lazarus, Free Pascal				            </title>
            <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-format-integer-or-int64-with-thousands-separator/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 09 Jun 2026 02:22:37 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Lazarus - Format Integer or Int64 with thousands separator</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-format-integer-or-int64-with-thousands-separator/#post-3060</link>
                        <pubDate>Wed, 03 Feb 2021 15:34:12 +0000</pubDate>
                        <description><![CDATA[Note:
If the thousands separator does not appear, then your&#039;ll need to set if the DefaultFormatSettings.DecimalSeparator value.I&#039;ve done it like this (since I didn&#039;t find a reliable other m...]]></description>
                        <content:encoded><![CDATA[<p>Note:</p>
<p>If the thousands separator does not appear, then your'll need to set if the <strong>DefaultFormatSettings.DecimalSeparator</strong> value.<br />I've done it like this (since I didn't find a reliable other method):</p>
<pre>if DefaultFormatSettings.DecimalSeparator='.' then<br />  DefaultFormatSettings.ThousandSeparator:=','<br />else<br />  DefaultFormatSettings.ThousandSeparator:='.';</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-format-integer-or-int64-with-thousands-separator/#post-3060</guid>
                    </item>
				                    <item>
                        <title>Lazarus - Format Integer or Int64 with thousands separator</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-format-integer-or-int64-with-thousands-separator/#post-515</link>
                        <pubDate>Mon, 25 Mar 2019 11:44:04 +0000</pubDate>
                        <description><![CDATA[This took me a few seconds to figure out, so as usual I post my &quot;solution&quot; here.
What is the situation?I have a file size (using the FileUtils.FileSize(&#039;filename&#039;) function in bytes (Int64)...]]></description>
                        <content:encoded><![CDATA[<p>This took me a few seconds to figure out, so as usual I post my "solution" here.</p>
<p>What is the situation?<br />I have a file size (using the FileUtils.FileSize('filename') function in bytes (Int64).<br />However I'd like to display that with the thousands separator, so for example 1234567890 becomes 1,234,567,890.</p>
<p>the default functions didn't like the fact that I passed it an Integer (why would this even be a problem?) and the documentation of the Format function (<a href="http://wiki.freepascal.org/Format_function" target="_blank" rel="noopener noreferrer">here</a> and <a href="https://www.freepascal.org/docs-html/rtl/sysutils/format.html" target="_blank" rel="noopener noreferrer">here</a>) are kind-a crappy ... (I can't complain, since I'm not updating the Wiki page either)</p>
<p>Anyhoo, the fix:</p>
<pre contenteditable="false">var
  FileSizeInBytes:int64;
...
  Label1.Caption := Format('%.0N',);
...</pre>
<p>To make the Integer (int64) a float, I add 0.1 and next subtract 0.1. To format the new "float" without numbers behind the decimal point (.0) and have it use thousands separators (N), use the "<strong>%.0N</strong>" format placeholder.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-format-integer-or-int64-with-thousands-separator/#post-515</guid>
                    </item>
							        </channel>
        </rss>
		