I am working on a .Net application.
I have a requirement such that I may getting input value as "-21455.254746" and I would like to handle such that this will be displayed as (21455.25)
" on UI and even in export to word or excel.
I mean negative values should display in Parenthesis and decimal point to rounded to two.
The below Formatting is working fine on UI and Export to word. but in excel export, parenthesis is missing.
string resultValue = Convert.ToDouble("-21455.254746").ToString("#,##0.00;(#,##0.00);0.00");
This value will be binded to the gridview (asp.net).
Please someone advise the best way to do it and works for excel as well...