public bool isPercentageScan; //next scan public ScanParameters() { //default config ScanOption = ScanOptions.soExactValue; VarType = VarTypes.vtDword; RoundingType = RoundingTypes.rtExtremerounded; StartAddress = 0; StopAddress = (UInt64)(Int64.MaxValue); ProtectionFlags = "+W-C"; //wirable, not copy-on-write, and ignore execute AlignmentType = FastScanMethods.fsmAligned; AlignmentValue = "4"; isHexadecimalInput = false; isUTF16Scan = false; isCaseSensitive = false; isPercentageScan = false; }
public static decimal Rounding(decimal d, RoundingTypes roundingType, int roundingDigit) { return (decimal)Rounding((double)d, roundingType, roundingDigit); }
public static double Rounding(double dMarkups, RoundingTypes roundingType, int roundingDigit) { if (dMarkups <= 0) return dMarkups; dMarkups = dMarkups / Math.Pow(10, roundingDigit); switch (roundingType) { case RoundingTypes.Ceiling: dMarkups = Math.Ceiling(dMarkups); break; case RoundingTypes.Floor: dMarkups = Math.Floor(dMarkups); break; case RoundingTypes.Round: dMarkups = Math.Round(dMarkups); break; } return dMarkups * Math.Pow(10, roundingDigit); }