---
title: "från float till int i C#?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/135132-från-float-till-int-i-c"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "ChrilleMZ"
published: "2005-10-02T17:12:58.000Z"
updated: "2005-10-02T20:18:15.000Z"
replies: 2
views: 393
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/135132-från-float-till-int-i-c"
---

# från float till int i C#?

## #1 — ChrilleMZ, 2005-10-02T17:12Z

Någon som vet hur man koverterar ett flyttal till ett heltal?

Permalänk: https://www.webforum.nu/p/135132

## #2 — nitro2k01, 2005-10-02T17:30Z

```
theInt = (int)theFloat;
```

...kanske?

/r Jag skrev inte kanske för att verka spydig, utan därför att jag googlade lite och gissade mig till detta svar, som är otestat.

Permalänk: https://www.webforum.nu/p/1680647

## #3 — P, 2005-10-02T20:18Z

int i = Convert.ToInt(4.55) annars

Permalänk: https://www.webforum.nu/p/1680711

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/135132-från-float-till-int-i-c
