I'm stuck. I need some help.
This if statement fails and I am stumped as to why it would.

[snip]
// Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
nfi.CurrencyDecimalDigits = 2;
[snip]
e.Item.Cells[cellIndex-1].Text = outCost.ToString("C",nfi);

[snip]
if(Double.TryParse(e.Item.Cells[i].Text,NumberStyles.Currency|NumberStyles.N
umber, NumberFormatInfo.InvariantInfo,out Temp))
{
    //we never make it here. debugger shows e.Item.Cells[i].Text = $0.01
    //e.Item.Cells[i].Text.Length is 5
}

changing e.Item.Cells[i].Text = outCost.ToString("0.##") will cause the if
statement to work correctly. Wierd??? But I absolutely need it to be "C",nfi

Thanks

Reply via email to