public static double alignToInt(double usrValue, @NotNull ScaleContext ctx, @Nullable RoundingMode rm, @Nullable ParityMode pm) {
    if (rm == null) rm = ROUND;
    double scale = getScale(ctx);
    if (scale == 0) return 0;

    int devValue = devValue(usrValue, scale, pm != null && rm == ROUND ? FLOOR : rm);
    if (pm != null && ParityMode.of(devValue) != pm) {
      devValue += rm == FLOOR ? -1 : 1;
    }
    return devValue / scale;
  }
public static double alignToInt(double usrValue, @NotNull ScaleContext ctx, @Nullable RoundingMode rm, @Nullable ParityMode pm)