I am parsing a CSV file into an array. One element of array is .0000 I want to parse this as 0 but when I tried to parse .0000 using following methods it returns 1
fields[38].Substring(0,fields[38].IndexOf(".")) // expected 0, return 1
Convert.ToDecimal(fields[38]) // expected 0.00, return Exception
string.Equals(fields[38],".0000") // expected true, return false
(int)decimal.Parse(fields[38]) // expected 0, return 1
Help Please !!!!!!!!
This works, not sure if there’s an easier way:
Decimal.Parse Method (String, NumberStyles, IFormatProvider)