Codota Logo
MonetaryAmountFactoryQueryBuilder.setMaxScale
Code IndexAdd Codota to your IDE (free)

How to use
setMaxScale
method
in
javax.money.MonetaryAmountFactoryQueryBuilder

Best Java code snippets using javax.money.MonetaryAmountFactoryQueryBuilder.setMaxScale (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.javamoney/javamoney-tck

/**
 * Creates an amount with the given scale.
 * @param scale the target scale
 * @return the new amount.
 */
public static MonetaryAmount createAmountWithScale(int scale) {
  MonetaryAmountFactoryQuery tgtContext = MonetaryAmountFactoryQueryBuilder.of().setMaxScale(scale).build();
  MonetaryAmountFactory<?> exceedingFactory;
  try {
    exceedingFactory = Monetary.getAmountFactory(tgtContext);
    AssertJUnit.assertNotNull(exceedingFactory);
    MonetaryAmountFactory<? extends MonetaryAmount> bigFactory =
        Monetary.getAmountFactory(exceedingFactory.getAmountType());
    return bigFactory.setCurrency("CHF").setNumber(createNumberWithScale(scale)).create();
  } catch (MonetaryException e) {
    return null;
  }
}
origin: JavaMoney/javamoney-examples

/**
 * @param args
 */
public static void main(String[] args) {
  MonetaryAmount amount = Monetary.getDefaultAmountFactory().setCurrency("EUR").setNumber(234).create();
  ConsoleUtils.printDetails(amount);
  amount = Monetary.getAmountFactory(FastMoney.class).setCurrency("EUR").setNumber(234).create();
  ConsoleUtils.printDetails(amount);
  amount = Monetary.getAmountFactory(
        MonetaryAmountFactoryQueryBuilder.of().setMaxScale(50).setPrecision(30).build())
         .setCurrency("EUR").setNumber(234).create();
  ConsoleUtils.printDetails(amount);
  Money amt1 = Money.of(10.1234556123456789, "USD");
  FastMoney amt2 = FastMoney.of(123456789, "USD");
  Money total = amt1.add(amt2).multiply(0.5)
      .remainder(1);
  ConsoleUtils.printDetails(total);
}
javax.moneyMonetaryAmountFactoryQueryBuildersetMaxScale

Javadoc

Sets the maximal scale to be supported.

Popular methods of MonetaryAmountFactoryQueryBuilder

  • of
    Creates a new instance of javax.money.CurrencyQueryBuilder.
  • build
    Creates a new instance of MonetaryAmountFactoryQuery based on the values of this Builder. Note that
  • setPrecision
    Sets the required precision, the value 0 models unlimited precision.
  • <init>
    Creates a new instance of javax.money.CurrencyQueryBuilder.
  • importContext
  • set
  • setTargetType

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now