Тема: AHK: Дробные переменные
Приветствую всех. У меня такой вопрос, как убрать десятичную дробь, чтобы при расчете показывалось целое число.
Вы не вошли. Пожалуйста, войдите или зарегистрируйтесь.
Страницы 1
Чтобы отправить ответ, вы должны войти или зарегистрироваться
Приветствую всех. У меня такой вопрос, как убрать десятичную дробь, чтобы при расчете показывалось целое число.
Про округление.
Round, Value1 [, N]: If N is omitted, OutputVar will be set to Value1 rounded to the nearest integer. If N is positive number, Value1 will be rounded to N decimal places. If N is negative, Value1 will be rounded by N digits to the left of the decimal point. For example, -1 rounds to the ones place, -2 rounds to the tens place, and-3 rounds to the hundreds place. Note: Round does not remove trailing zeros when rounding decimal places. For example, 12.333 rounded to one decimal place would become 12.300000. This behavior can be altered by using something like SetFormat, float, 0.1 prior to the operation (in fact, SetFormat might eliminate the need to use Round in the first place). Corresponding function: Round(Number [, N]).
Или читайте в разделе Функции, пункт "Общая математика" русского перевода:
Ceil(Number)
Floor(Number)
Round(Number [, N])
Спасибо.
Страницы 1
Чтобы отправить ответ, вы должны войти или зарегистрироваться