Round number with broker 5 digit

 

HI all, I need to round High & Low number of candlestick ( broker 5 digits) , as in this example

High = 1.12346

Low =  1.12345

I need to obtain High = 1.1235 and Low = 1.1234.

I’m trying to use MathRound() and NormalizeDouble() it work with High , but it doesn’t work with Low.

Could you help me? Thanks!!!

 
bizu:

HI all, I need to round High & Low number of candlestick ( broker 5 digits) , as in this example

High = 1.12346

Low =  1.12345

I need to obtain High = 1.1235 and Low = 1.1234.

I’m trying to use MathRound() and NormalizeDouble() it work with High , but it doesn’t work with Low.

Could you help me? Thanks!!!

1.12345  would normally rounds up,  it is standard practice that 5 and above goes up,  4 and below goes down.

You need to do things slightly different if you want 5 to round down.  Do this . . .

double High = 1.12346;
double Low =  1.12345;

High -= Point / 10;
Low -= Point / 10;

High = NormalizeDouble(High, Digits - 1);
Low = NormalizeDouble(Low, Digits - 1);
Reason: