简体   繁体   中英

How to use Format() procedure in VBScript

I would need some help with the Format function. I would to like this function in order to use scientific notation for my calculations. I understood that you should use Format(number,"e") to achieve this but I am constantly getting a runtime error saying that there was a type mismatch. Any suggestion?

Thanks

Use a .NET StringBuilder:

>> Set sb = CreateObject("System.Text.StringBuilder")
>> sb.AppendFormat "{0:E}", 1234.5678
>> WScript.Echo sb.ToString()
>>
1,234568E+003
>>

Background/Class/Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM