<?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="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18362&amp;type=atom" />
	<updated>2025-01-30T18:30:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18362</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Преобразование числа в размер в мегабайтах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161943#p161943" />
			<content type="html"><![CDATA[<p><strong>1srafel</strong></p><div class="codebox"><pre><code>;Для проверки: https://allcalc.ru/converter/megabytes-kilobytes

F2:: ; Для теста:
T=
Loop, 30{
 Random, R, 0, 1234567890123
 T .= R &quot;   &gt;&gt;&gt;   &quot; FormatFileSize(R) &quot;`n&quot;
}
MsgBox, % T
Return


FormatFileSize(Size, R := 2){
 Static T := [&quot;Байт&quot;, &quot;Кб&quot;, &quot;Мб&quot;, &quot;Гб&quot;, &quot;Тб&quot;], TM := T.Count()
 I := 1
 while( (size &gt;= 1024) And (I &lt; TM))
  Size := (Size / 1024), I++
 Return ARound(Size, R) &quot; &quot; T[i]
}

ARound(D, R := 2){	; Число, Округление до N знаков после запятой.
 Return RTrim(RTrim(Round(D, R),&quot;0&quot;), &quot;.&quot;)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-01-30T18:30:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161943#p161943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Преобразование числа в размер в мегабайтах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161942#p161942" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>8306546/1024/1024=7,92173957824707</code></pre></div><p><a href="https://tinkova.ucoz.ru/index/edinicy_izmerenija/0-96">Таблица байтов.</a></p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2025-01-30T12:21:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161942#p161942</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Преобразование числа в размер в мегабайтах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161941#p161941" />
			<content type="html"><![CDATA[<p>Добрый день. Есть такое значение, -<br /></p><div class="codebox"><pre><code>&quot;size&quot;:8306546,</code></pre></div><p>которое должно конвертироваться в &quot;7,9 МБ&quot;. По какому принципу оно закодировано?</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-01-30T11:50:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161941#p161941</id>
		</entry>
</feed>
