Hello
I have a xml node that gives me the following value 4,2, I then convert it to decimal, I use it to make some calculations, I then use the string again to replace the "," for "." and I add zeros to the left and right of the "." and the result should be something like:
000000004.20, instead I get 000000004.22, where the heck those decims appeared? it happens again to another value 16,80 it apperars again 000000016.88 it should appear 000000016.80, at present it happens only for those values, there are other string transformations that go correctly but those two values (so far) don't to me this is odd, I even used system.globalization.
Code:
pUnit =
pUnit = xmldoc.SelectSingleNode(
pUnit = pUnit.Replace(
....
/////////////////Some calculations
......
NFormat.NumberDecimalDigits = 2;
pUnitArray = pUnit.Split(
{
pUnit1 = pUnitArray[0].Length;
pUnit2 = 0;
pUnit_temp2 =
}
pUnit2 = pUnitArray[1].Length;
pUnit_temp2 = pUnitArray[1];
pUnit_temp1 +=
pUnit = pUnit_temp1 + pUnit +
pUnit = pUnit_temp1 + pUnit;
pUnit_temp2 +=
pUnit = pUnit + pUnit_temp2;