congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
NativeDecimalFormat.setRoundingMode
Code IndexAdd Tabnine to your IDE (free)

How to use
setRoundingMode
method
in
libcore.icu.NativeDecimalFormat

Best Java code snippets using libcore.icu.NativeDecimalFormat.setRoundingMode (Showing top 14 results out of 315)

origin: robovm/robovm

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: robovm/robovm

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: com.bugvm/bugvm-rt

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: com.mobidevelop.robovm/robovm-rt

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: MobiVM/robovm

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: ibinti/bugvm

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: FlexoVM/flexovm

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: com.gluonhq/robovm-rt

public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) {
  final int nativeRoundingMode;
  switch (roundingMode) {
  case CEILING: nativeRoundingMode = 0; break;
  case FLOOR: nativeRoundingMode = 1; break;
  case DOWN: nativeRoundingMode = 2; break;
  case UP: nativeRoundingMode = 3; break;
  case HALF_EVEN: nativeRoundingMode = 4; break;
  case HALF_DOWN: nativeRoundingMode = 5; break;
  case HALF_UP: nativeRoundingMode = 6; break;
  default: throw new AssertionError();
  }
  setRoundingMode(address, nativeRoundingMode, roundingIncrement);
}
origin: MobiVM/robovm

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: com.bugvm/bugvm-rt

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: ibinti/bugvm

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: com.gluonhq/robovm-rt

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: com.mobidevelop.robovm/robovm-rt

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
origin: FlexoVM/flexovm

  /**
   * Sets the {@code RoundingMode} used by this {@code NumberFormat}.
   * @since 1.6
   */
  public void setRoundingMode(RoundingMode roundingMode) {
    if (roundingMode == null) {
      throw new NullPointerException("roundingMode == null");
    }
    this.roundingMode = roundingMode;
    if (roundingMode != RoundingMode.UNNECESSARY) { // ICU4C doesn't support UNNECESSARY.
      double roundingIncrement = 1.0 / Math.pow(10, Math.max(0, getMaximumFractionDigits()));
      ndf.setRoundingMode(roundingMode, roundingIncrement);
    }
  }
}
libcore.icuNativeDecimalFormatsetRoundingMode

Popular methods of NativeDecimalFormat

  • <init>
  • applyLocalizedPattern
  • applyPattern
  • applyPatternImpl
  • clone
  • cloneImpl
  • close
  • equals
    Note: this doesn't check that the underlying native DecimalFormat objects' configured native Decimal
  • formatBigDecimal
  • formatBigInteger
  • formatDigitList
  • formatDouble
  • formatDigitList,
  • formatDouble,
  • formatLong,
  • formatToCharacterIterator,
  • getAttribute,
  • getGroupingSize,
  • getMaximumFractionDigits,
  • getMaximumIntegerDigits,
  • getMinimumFractionDigits,
  • getMinimumIntegerDigits

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Permission (java.security)
    Legacy security code; do not use.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now