# Type Casting

*noun*

say it: **“TYPE KAST-ing”** **/taɪp ˈkæstɪŋ/**

Telling C# to convert a value to another type by writing the type in parentheses, such as (int)4.7.

## What is **Type Casting** in C#?

**Type Casting** — Explicitly converting a value to another compatible type.

```csharp
class TicketCounter
{
    void ConvertValues()
    {
        int tickets = 7;
        double exactTickets = tickets;
        int wholePrice = (int)7.9;
    }
}
```

## In a sentence

- “I used **type casting**, (int)average, to drop the decimals from the average score.”

Level: Novice · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=1)

Updated: November 9, 2026

## In other subjects

- [Type Casting in Java](https://www.ask-codey.com/glossary/type-casting)

Source: https://www.ask-codey.com/glossary/type-casting-c-sharp
