中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-08 14:14
47,811 topics / 349,895 posts / today 0 new / 48,253 members
DOS批处理 & 脚本技术(批处理室) » [Help] VBS outputting half of a number
Printable Version  850 / 8
Floor1 plp626 Posted 2008-05-12 11:02
银牌会员 Posts 1,020 Credits 2,278


Very strange, it shows .5 instead of 0.5
Floor2 huahua0919 Posted 2008-05-12 11:06
银牌会员 Posts 780 Credits 1,608
In ordinary programs, if the integer part is 0 it can usually be omitted; it doesn't affect the calculation.
Floor3 pooronce Posted 2008-05-12 11:08
中级用户 Posts 250 Credits 484
I'm still not familiar with vbs, but as far as I know, when the integer part is 0, omitting it is a common way of writing it.
(Even the function calculators we use ourselves can directly use .x to input data.)
Floor4 plp626 Posted 2008-05-12 11:10
银牌会员 Posts 1,020 Credits 2,278
So to display 0.5, it has to be like this:
Floor5 slore Posted 2008-05-12 13:22
铂金会员 Posts 2,478 Credits 5,212
Floor6 plp626 Posted 2008-05-12 14:37
银牌会员 Posts 1,020 Credits 2,278
& just mechanically concatenates them together, so that's how it is....
Floor7 jmz573515 Posted 2008-05-14 08:10
银牌会员 Posts 464 Credits 1,212
Floor8 plp626 Posted 2008-05-14 11:52
银牌会员 Posts 1,020 Credits 2,278
Originally posted by jmz573515 at 2008-5-14 08:10 AM:
msgbox FormatNumber(1/2,1,-1)

(1/2,1,-1)

Why add 1 and -1 after it?
Floor9 slore Posted 2008-05-14 12:15
铂金会员 Posts 2,478 Credits 5,212
Look at the parameters of formatnumber...
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023