用于比较浮点数的便利函数
bool EQ(double a, double b, int digits = 8); bool GT(double a, double b, int digits = 8); bool LT(double a, double b, int digits = 8); bool NE(double a, double b, int digits = 8); bool GE(double a, double b, int digits = 8); bool LE(double a, double b, int digits = 8);
用于浮点数四舍五入的便利函数
double RoundToDigit(double number, int digits); double RoundToDigitUp(double number, int digits); double RoundToDigitDown(double number, int digits); double RoundToStep(double number, double step); double RoundToStepUp(double number, double step); double RoundToStepDown(double number, double step); double RoundPrice(double pPrice, string pSymbol = NULL); double RoundVolume(double pVolume, string pSymbol = NULL);
由MetaQuotes Ltd译自英文
原代码: https://www.mql5.com/en/code/20822