<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Округление числа.]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=13068</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13068&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Округление числа.».]]></description>
		<lastBuildDate>Sat, 07 Oct 2017 12:19:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Округление числа.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119877#p119877</link>
			<description><![CDATA[<p>Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (aktor311)]]></author>
			<pubDate>Sat, 07 Oct 2017 12:19:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119877#p119877</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Округление числа.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119875#p119875</link>
			<description><![CDATA[<p>Целочисленное деление осуществляется через два слэша(//). Почитайте об этом <a href="http://www.script-coding.com/AutoHotkey/Variables.1.0.46.07.html">здесь</a>. Остаток от деления делимого на делитель, возвращает функция Mod(). Округление числа до нужной точности после запятой - Round(). О последних двух почитайте <a href="http://www.script-coding.com/AutoHotkey/Functions.html">тут</a>.</p><p>И пользуйтесь поиском. Все эти знания ни от кого не скрывают.<br /></p><div class="codebox"><pre><code>
k := 2000			; Капитал
r := 10				; Процент
r := r / 100
result := 17000		; Ожидаемый результат
months := 0
while (k &lt; result) {
	k += k * r
	months++
}
MsgBox,,Title,% &quot;Для роста капитала до &quot; result &quot; потребуется &quot; months &quot; месяц/цев/ца, или &quot; months//12 &quot; год/года/лет. А если быть чуть точнее, то &quot; Round(months/12,2) &quot; год(года)/лет&quot;
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (KusochekDobra)]]></author>
			<pubDate>Sat, 07 Oct 2017 10:57:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119875#p119875</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Округление числа.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119874#p119874</link>
			<description><![CDATA[<div class="codebox"><pre><code>
var := Round(var2) ; автоматическое округление
var := Ceil(var2) ; округление в большую сторону
var := Floor(var2) ; округление в меньшую сторону</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Sat, 07 Oct 2017 10:50:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119874#p119874</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Округление числа.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119873#p119873</link>
			<description><![CDATA[<p>Как округлить полученное число до целых?<br />Допустим<br /></p><div class="codebox"><pre><code>l=0

Gui, Add, ListBox, x2 y0 w230 h420 vDm, 
Gui, Add, Button, x66 y430 w100 h30 gSave, Запуск
Gui, Show, w236 h470, 
return

Save:
GuiControl,, Dm, Запущено

Input, Капитал, V, {sc1C}
k:=Капитал
GuiControl,, Dm, Капитал в %k% рублей

Input, Рост, V, {sc1C}
r:=Рост
GuiControl,, Dm, Рост %r% процентов

Input, Сумма, V, {sc1C}
s:=Сумма
GuiControl,, Dm, %s% рублей

Loop {
	if (k&lt;s)
		k:=k+(k*(r/100)) &amp;&amp; l++
	if (k&gt;=s)
		break
}
l:=l/12

GuiControl,, Dm, Через %l% лет(года).
return
GuiClose:
ExitAppp</code></pre></div><p>Тут я получаю l в месяцах, потом l/12 и получаются года. Как округлить конечный l до целых?<br />И есть ошибка в этой строчке<br /></p><div class="codebox"><pre><code>if (k&lt;s)
		k:=k+(k*(r/100)) &amp;&amp; l++</code></pre></div><p>Не могу понять в чем проблема.</p>]]></description>
			<author><![CDATA[null@example.com (aktor311)]]></author>
			<pubDate>Sat, 07 Oct 2017 10:10:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119873#p119873</guid>
		</item>
	</channel>
</rss>
