<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Формат числа с разрядностью]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12159&amp;type=atom" />
	<updated>2021-12-07T20:48:01Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12159</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151079#p151079" />
			<content type="html"><![CDATA[<p>Как, не покажете?</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T20:48:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151079#p151079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151078#p151078" />
			<content type="html"><![CDATA[<p>Функция создаётся один раз, одна для всего. Про Gui не было ни слова, следовательно это не было учтено.<br />Функцию необходимо тогда переделать на возврат данных.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-12-07T20:33:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151078#p151078</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151077#p151077" />
			<content type="html"><![CDATA[<p>Так зачем целый элемент закрывать, закрывайте только сам текст.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-12-07T20:27:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151077#p151077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151076#p151076" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong>Так смог придумать, но мне кажется что-то не так, закрывать каждый элемент GUI в функцию, такое себе.<br /></p><div class="codebox"><pre><code>Var1 := 15500
Var2 := 10000
Var3 := 20000
Var4 := (Var1+Var2)/1000
Var5 := (Var2+Var3)/1000

Test1(Var4)
Test2(Var5)


Test1(S, L := 1, T := &quot;кг&quot;){	; Число, Округление до N знаков после запятой, Текст.
	Gui, Add, text,, %  StrReplace(Round(S,L),&quot;.0&quot;) T
}
Test2(S, L := 1, T := &quot;кг&quot;){
	Gui, Add, text,, %  StrReplace(Round(S,L),&quot;.0&quot;) T
}
Gui,  Show</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T20:09:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151076#p151076</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151060#p151060" />
			<content type="html"><![CDATA[<p>В MsgBox выводит хорошо, а как мне применить в тексте GUI?</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T18:11:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151060#p151060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151057#p151057" />
			<content type="html"><![CDATA[<p>Можно через функцию сократить до такого:</p><div class="codebox"><pre><code>Var1 := 15500
Var2 := 10000
Var3 := 20000
Var4 := (Var1+Var2)/1000
Var5 := (Var2+Var3)/1000

Test(Var4)
Test(Var5)
Return

Test(S, L := 1, T := &quot;кг&quot;){	; Число, Округление до N знаков после запятой, Текст.
 MsgBox, % RTrim(RTrim(Round(S, L),&quot;0&quot;), &quot;.&quot;) T
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-12-07T17:29:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151057#p151057</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151054#p151054" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong> Подскажите пожалуйста, в примере ниже в первом сообщении результат 25.5кг, во втором 30.0кг. Как убрать во втором сообщении точку и ноль?<br /></p><div class="codebox"><pre><code>Var1 := 15500
Var2 := 10000
Var3 := 20000
Var4 := (Var1+Var2)/1000
Var5 := (Var2+Var3)/1000
MsgBox, % Round(Var4,1) &quot;кг&quot;
MsgBox, % Round(Var5,1) &quot;кг&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T17:19:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151054#p151054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151050#p151050" />
			<content type="html"><![CDATA[<p>Действительно, не учёл одну проблему - 100 обрежет до 1.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-12-07T17:10:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151050#p151050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151049#p151049" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong> Этот вариант вполне подходит, спасибо.<br /></p><div class="codebox"><pre><code>% Round(Var3,1) &quot;кг&quot;	</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T16:59:59Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151049#p151049</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151046#p151046" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><div class="codebox"><pre><code>MsgBox, % RTrim(Var3,&quot;0&quot;) &quot;кг&quot;	; Удалить &#039;0&#039; справа</code></pre></div></blockquote></div><p>Так не стоит, нужно удалять нули только после точки.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-12-07T16:58:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151046#p151046</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151045#p151045" />
			<content type="html"><![CDATA[<p>Выбрать по вкусу:</p><div class="codebox"><pre><code>MsgBox, % Round(Var3,1) &quot;кг&quot;	; Округлить до 1 цифры после запятой.
MsgBox, % RTrim(Var3,&quot;0&quot;) &quot;кг&quot;	; Удалить &#039;0&#039; справа.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-12-07T16:56:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151045#p151045</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151043#p151043" />
			<content type="html"><![CDATA[<p>Тот что в примере выше так, 35.5кг.</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T16:55:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151043#p151043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151042#p151042" />
			<content type="html"><![CDATA[<p>А как должен выглядеть результат этого скрипта?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-12-07T16:49:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151042#p151042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151041#p151041" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Я немного запутался, использую деление в переменной, а на выходе получаю кучу нулей после запятой. Что не так, скажите пожалуйста?<br /></p><div class="codebox"><pre><code>Var1 := 15500
Var2 := 20000
Var3 := (Var1+Var2)/1000
MsgBox, %Var3%кг</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T16:45:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151041#p151041</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Формат числа с разрядностью]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151035#p151035" />
			<content type="html"><![CDATA[<p>Хм, интересно, я как-то про это не подумал. Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2021-12-07T14:30:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151035#p151035</id>
		</entry>
</feed>
