To format an integer to currency with 2 decimals is String.Format("{0:c}", 12345578), with no decimal is 123456789.ToString("$#,##0;($#,##0);Zero").
It work for formating a textbox in DataList for 2 decimals by using String.Format("{0:c}",DataBinder.Eval(container, "DataItem.Allocaiton")), but it doesn't work for no decimal using DataBinder.Eval(container, "DataItem.Allocaiton").ToString("$#,##0;($#,##0);Zero").
How can I format currency with no decimal in a DataList textbox? Thanks.
DanYeung
It work for formating a textbox in DataList for 2 decimals by using String.Format("{0:c}",DataBinder.Eval(container, "DataItem.Allocaiton")), but it doesn't work for no decimal using DataBinder.Eval(container, "DataItem.Allocaiton").ToString("$#,##0;($#,##0);Zero").
How can I format currency with no decimal in a DataList textbox? Thanks.
DanYeung