PDA

View Full Version : Formatting problem


blarouche
10-01-2009, 08:16 AM
Hi guys,


I have a formatting proble. I am trying to get a double from an indicator with the two digit format.

My code is :
String.Format("{0:0.00}",Myindicator().Values[0]);


I always get a result like : 2.64348248203103

I would like to keep only two digit after the dot...

Bernard

NinjaTrader_Bertrand
10-01-2009, 08:48 AM
Bernard, did you try truncating this with Math.Truncate?

blarouche
10-01-2009, 09:00 AM
I don't know why but i solved my problem this way :

I created a new double value in the exporting indicator which exposed the same variable. The formatting code was then applied and it worked !


Thanks

Bernard