How to return value to 1 decimal place ??

 
Greetings all,

I am trying to calculate a formula that will allow 5% of account equity to be used as lots size.
So on a 10k account it would set a lot size of 0.5 lots, 50k acc would be 2.5 lots etc......
This is the formula.

Levv = MathAbs((AccountEquity()*Perc/100/100)/10);

Perc is declared as an exernal double.

I need to round this down to 1 decimal place so mt4 will acept the order.

I have tried mathround() but it will round it to 1 lot.

Thanks & GT......
 
double norm=NormalizeDouble(your_value,1)
int firstnum=(norm-MathFloor(your_value))*10;

see also our library stdlib.mq4, DoubleToStrMorePrecision function
 
Thanks Slawa..
fwiw mt4 is working great at my end keep up the good work :)
Reason: