title: How can I specify an integer's total number of digits in VBScript?
body: <p>I have a "text field" in SSRS in Visual Studio 2008 that I would like to convert to a number in order for the export to Excel to work. Simply changing the properties to Number does not work. So I've decided to try to write some code in the Value field for it to work.</p>
  
  <p>I have an invoice number that must always have seven digits, e.g. 1938576, 0000001. Using <code>CInt(Fields!Invoice.Value)</code> does not work as it does not keep any leading zeroes. How can I convert this field to a numerical value (integer for this one, but I have a couple other fields that it must work with doubles) while also determining exactly how many digits must be shown? Something like <code>CInt(Fields!Invoice.Value, 7)</code> would be great, but I don't think that parameter is part of the function.</p>