Question Number Format??????

Errods

Well-known member
Joined
Dec 17, 2007
Messages
71
Location
Kundapur, Karnataka, Udupi, India.
Programming Experience
1-3
Hi All,

I have a listview where the data retirved fom a DB is displaed to the user arranged as Rows and Coloums.

I want an integer value such as 10 or 289 to be shown with 2 decimal points i.e. 10.00 or 289.00 how do i achive this...........
 
ListView control doesn't have data formatting, each data has to be formatted when adding the item string. Use ToString method specifying the Fixed-point Standard Numeric Format String "f". For my culture this defaults to 2 digits precision, but you can add "2" as precision specifier to be sure.
VB.NET:
Dim s As String = (123).ToString("f2")
Note that current cultures NumberFormatInfo is used so correct decimal separator is also displayed.
 
Back
Top