C # collects several ToString () formats

Source: Internet
Author: User

stringR1 = -. ToString ("C");//¥1,200.00
stringr2 = -. ToString ("D3");//025
stringR3 =2500.1231. ToString ("F2");//2500.12
stringR4 =20000.5. ToString ("N");//20,000.50
stringR5 =0.5. ToString ("P");//50%
stringR6 = Guid.NewGuid (). ToString ("N");//32-bit number: 00000000000000000000000000000000
stringR7 = Guid.NewGuid (). ToString ("D");//32-bit digits separated by hyphens: 00000000-0000-0000-0000-000000000000
stringR8 = Guid.NewGuid (). ToString ("P");//32 digits separated by hyphens enclosed in parentheses: (00000000-0000-0000-0000-000000000000)
stringR9 = Guid.NewGuid (). ToString ("B");//32-digit number separated by a hyphen, enclosed in curly braces: {00000000-0000-0000-0000-000000000000}
stringR10 = Guid.NewGuid (). ToString ("X");//four hexadecimal values are enclosed in curly braces, where the fourth value is also a subset of the eight hexadecimal values enclosed in curly braces:{0x00000000, 0x0000, 0x0000,{0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00}}

C # collects several ToString () formats

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.