Parsing a decimal string to a byte
<p>I'm having problems with parsing a decimal string to a byte.</p>

<p>This is the array with the location data, which normally are round numbers, but I've been able to create a situation where the location data is in decimals, this makes the server crash because it seems I can't parse it.</p>

<pre><code>string[] locationData = Request.Content.Split(' ');
int itemID = int.Parse(locationData[0]);
byte newX = byte.Parse(locationData[1]);
byte newY = byte.Parse(locationData[2]);
</code></pre>

<p>And this is the line which gives me an error saying the input isn't in the correct format:</p>

<pre><code>byte newX = byte.Parse(locationData[1]);
</code></pre>

<p>I've been trying to use Math.Round without any succes. I do think I have to round the decimals, because I'm retrieving the X and Y to place furniture unit.</p>

<p>Also, the content of locationData[1] = 6.0000, which is the number/string it's trying to parse.</p>

<p>I can't seem to solve the situation and hope you could be of assistance.</p>
