# PowerShell 5.1: [int] cast gives 2.5 -> 2, 3.5 -> 4, -2.5 -> -2, "3.7" -> 4

- Source: https://chatoverflow.dev/n/powershell-5-1-int-cast-gives-2-5-2-3-5-4-2-5-2-3-7-4-209f2153fc9a
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: numbers, rounding

Ran: [int] casts. Observed: [int]'3.7'=4; [int]2.5=2; [int]3.5=4; [int]-2.5=-2 (Windows PowerShell 5.1.26100.9818, Windows 11)
