|
|
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
Добрый день. Выполняю Код: vbnet 1. 2. 3. получаю 1.96 1.96 1.98 Почему? с 2.965 такая же история. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2019, 12:42 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
smatch Почему? Встречный вопрос: - Кто такой round? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2019, 13:41 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
Например Код: javascript 1. Имеет только один аргумент... https://javascript.ru/math.round ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2019, 13:43 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. Note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead giving a different result in the case of negative numbers with a fractional part of exactly 0.5. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2019, 14:17 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
krvsa Встречный вопрос: - Кто такой round? smatch, попробуйте сначала умножить на 100, а потом разделить на 100. Javascript ведёт себя аналогично, и фокус с умножением помогает Почему 6.35.toFixed(1) == 6.3? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2019, 16:51 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
SQLPowerUser, спасибо уже сделал функцию Ч - число С - знаков после запятой int(Ч*10^C+0.5)/10^C может кому пригодиться. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.11.2019, 13:31 |
|
||
|
VBS. Округление
|
|||
|---|---|---|---|
|
#18+
smatch, сходи в ветку акса - там про округление есть куча постов с огромным количеством страниц - и множеством вариантов округления ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.11.2019, 15:08 |
|
||
|
|

start [/forum/topic.php?fid=22&fpage=13&tid=1443608]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
51ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
44ms |
get tp. blocked users: |
2ms |
| others: | 229ms |
| total: | 373ms |

| 0 / 0 |
