开发者

How to convert "Double" to formatted string in VBScript

I was working on small script in VB. I need to format a double number which is result of division. Thus there could be many digits after decimal places. I need to convert it to String with only two decimals places. I used to do it in C#开发者_JAVA技巧 with Double.ToString("0.##"); is there any methode like that in VBScript ..

Please help ..

Himanshu


You're going to want the FormatNumber function. FormatNumber(num, 2) will give you the number formatted to 2 decimal points. See the link for more details.

http://www.w3schools.com/vbscript/func_formatnumber.asp

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜