0

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

Jen R
  • 1,527
  • 18
  • 23
Neli
  • 1
  • 1

1 Answers1

2

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

Community
  • 1
  • 1
Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96
  • Hi! Thanks for the suggestion with the .Net StringBuilder! One more question: Can I use these commands line in a .vbs script? – Neli Mar 18 '15 at 16:41