Ashok
asked on
Easy question
double d1 = 8501.23;
double d2 = -199;
double d3 = 0;
I want it to format using String.Format to output as
@8,501.13@
@(199)@
@@
using
string sResult;
sResult = "@" + Formula_Result_Here + "@";
Thanks,
Ashok
double d2 = -199;
double d3 = 0;
I want it to format using String.Format to output as
@8,501.13@
@(199)@
@@
using
string sResult;
sResult = "@" + Formula_Result_Here + "@";
Thanks,
Ashok
Hi
Check -Ve Value then add (Value)
string Formula_Result_Here= string.empty
If (Given_value) < 0 then
{
Formula_Result_Here = "(" & Given_value & ")"
Check -Ve Value then add (Value)
string Formula_Result_Here= string.empty
If (Given_value) < 0 then
{
Formula_Result_Here = "(" & Given_value & ")"
use
String.Format("@{0:#,0.##;(#,0.##); }@", 0);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
replace 0 at the end there with d1, d2 and d3 :)
Bellow URL Give some Information
http://www.csharp-examples.net/string-format-double/