Custom Numeric Formatting: Decimal Point ({0:#####.000}, {0:##.000}) : Number format « Data Type « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Data Type » Number format 
2.55.7.Custom Numeric Formatting: Decimal Point ({0:#####.000}, {0:##.000})
using System;
class Test
{
    public static void Main()
    {
        Console.WriteLine("{0:#####.000}"75928.3);
        Console.WriteLine("{0:##.000}"1456.456456);
    }
}
75928.300
1456.456
2.55.Number format
2.55.1.To format numeric data
2.55.2.Numeric Formatting: Decimal ({0:D}, {0:D7})
2.55.3.Numeric Formatting: Fixed-Point ({0:F}, {0:F0}, {0:F5})
2.55.4.Numeric Formatting: General ({0:G}, {0:G7}, {0:G4})
2.55.5.Numeric Formatting: Number ({0:N}, {0:N4})
2.55.6.Numeric Formatting: Scientific (Exponential) ({0:E}, {0:E10}, {0:e4})
2.55.7.Custom Numeric Formatting: Decimal Point ({0:#####.000}, {0:##.000})
2.55.8.Custom Numeric Formatting: Digit or Space Placeholder ({0:#####}, {0:###})
2.55.9.Custom Numeric Formatting: Digit or Zero Placeholder ({0:000})
2.55.10.Custom Numeric Formatting: Escapes and Literals ({0:###\\#})
2.55.11.Custom Numeric Formatting: Exponential Notation ({0:###.000E-00}, {0:#.0000000E+000})
2.55.12.Custom Numeric Formatting: Group Separator ({0:##,###}, {0:##,000.000})
2.55.13.Custom Numeric Formatting: Number Prescaler ({0:000,,,.###})
2.55.14.Custom Numeric Formatting: Percent Notation ({0:##.000%})
2.55.15.Custom Numeric Formatting: Section Separator ({0:###.00;0;(###.00)})
2.55.16.Format number: C, D9, E, F3, N, X, x
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.