Format int value

In this chapter you will learn:

  1. Use CultureInfo in int.ToString method

Use CultureInfo in int.ToString method

using System;//from  j a v a2s .  co m
using System.Globalization;
public class NumParsingApp {
    public static void Main(string[] args) {

        int k = 12345;
        CultureInfo us = new CultureInfo("en-US");
        string v = k.ToString("c", us);
        Console.WriteLine(v);
    }
}

Next chapter...

What you will learn in the next chapter:

  1. hexadecimal int
  2. Octal int
  3. Format integer as hexadecimal
  4. Format integer as octal and binary numbers
Home » C# Tutorial » Byte, Integer, Long
Integer Family
Integer ranges
byte
Convert to byte
Parse string to byte
byte format
byte octal and hexadecimal
byte binary operation
byte overflow with unchecked
int
int value
Compare int value
int calculation
int value overflow
int binary operation
Parse string to int value
Format int value
int in binary, octal and hexadecimal
long
long value calculation
ulong