Question: In a text file full of numbers separated by spaces, and with every single one having decimals (even whole integers, e.g. not just "50" but "50.000000", how can Powershell be used to round all numbers to the nearest integer? They are off the mark exclusively by less than 1, so literally just rounding to the nearest whole number. EXCEPT, I want to also keep zeros/not truncate them so that "-2499.999756" becomes "-2500.000000" It's not just negative numbers. 

I rarely use this website so my sincerest apologies if anything about this question is improper etiquette. 

[Granted, there's no guarantee this will accomplish what I want to do but I still want to try to remove irregularities in a 3D model I made.](https://i.stack.imgur.com/Qi7Tk.png)

Answer: 
You can use the `[math]` namespace to access mathematical functions.

Here we use the `Round` function to round a number

```
[math]::Round("-2499.999756") # returns -2500

```

Then we can format the number to 6 decimal places using the `ToString` method:

```
[math]::Round("-2499.999756").ToString("#.000000") # returns -2500.000000

```
If the file has a header line you've to remove the `-Header` parameter and change the column names following `$Row.`

```
$InFile = '.\Dungeon_Q.obj'
$CSV = Import-Csv $InFile -Delimiter ' ' -Header C1,C2,C3,C4
ForEach ($Row in $CSV){
  "{0} {1:N6} {2:N6} {3:N6}" -f $Row.C1,[math]::floor($Row.C2),[math]::floor($Row.C3),[math]::floor($Row.C4)
}

```

Sample output of the first four lines:

```
v 200,000000 -2.200,000000 200,000000
v 400,000000 -2.200,000000 200,000000
v 500,000000 -2.200,000000 200,000000
v -500,000000 -2.100,000000 200,000000

```