formattting numerics

  • Thread starter Thread starter Brent Burkart
  • Start date Start date
B

Brent Burkart

I need to produce a text file that contains information in certain places.
In other words position 5-10 needs to be a numeric with the last three
places being ".00" If it is zero then it needs to be "0.00".

How do I format my input to handle this and surpress leading zeros?

Thanks,
Brent
 
Hi Brent,

At the risk of sounding boring, I'll repeat what I gave you last time.

Formatting of values and strings is powerful in VB.NET. It's very worthwhile
learning how these string formats work.

Take a look at these topics in MSDN.

String.Format
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/fr
lrfsystemstringclassformattopic1.asp

Formatting Overview
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/
cpconformattingoverview.asp

Regards,
Fergus
 
* "Brent Burkart said:
I need to produce a text file that contains information in certain places.
In other words position 5-10 needs to be a numeric with the last three
places being ".00" If it is zero then it needs to be "0.00".

How do I format my input to handle this and surpress leading zeros?

'Format(<expression>, "0.00")'.
 
Back
Top