Examples of Currency


Examples of java.util.Currency

  private static final String UK_CURRENCY_CODE = "GBP";

  public void test(TestHarness harness)
  {
    Currency currency1;
    Currency currency2;
    boolean threwException;

    /* Get a UK Currency instance */
    currency1 = Currency.getInstance(Locale.UK);
    /* And another */
 
View Full Code Here

Examples of java.util.Currency

  private static final String CURRENCY_SYMBOL = "$";
  private static final int FRACTION_DIGITS = 2;

  public void test(TestHarness harness)
  {
    Currency currency;

    /* Set default Locale for the JVM */
    Locale.setDefault(TEST_LOCALE);
    /* Get an instance of the currency */
    currency = Currency.getInstance(TEST_LOCALE);
    /* Check for the correct currency code */
    harness.check(currency.getCurrencyCode(),ISO4217_CODE, "ISO 4217 currency code retrieval check (" +
                  currency.getCurrencyCode() + ").");
    /* Check for the correct currency symbol */
    harness.check(currency.getSymbol(), CURRENCY_SYMBOL, "Currency symbol retrieval check (" +
                  currency.getSymbol() + ").");
    /* Check for the correct fraction digits */
    harness.check(currency.getDefaultFractionDigits(), FRACTION_DIGITS, "Currency fraction digits retrieval check (" +
                  currency.getDefaultFractionDigits() + ").");
    /* Check for the correct currency code from toString()*/
    harness.check(currency.toString(),ISO4217_CODE, "ISO 4217 currency code retrieval check (" + currency.toString() + ").");
  }
View Full Code Here

Examples of java.util.Currency

  private static final String CURRENCY_SYMBOL = "\uFFE5";
  private static final int FRACTION_DIGITS = 0;

  public void test(TestHarness harness)
  {
    Currency currency;

    /* Set default Locale for the JVM */
    Locale.setDefault(TEST_LOCALE);
    /* Get an instance of the currency */
    currency = Currency.getInstance(TEST_LOCALE);
    /* Check for the correct currency code */
    harness.check(currency.getCurrencyCode(),ISO4217_CODE, "ISO 4217 currency code retrieval check (" +
                  currency.getCurrencyCode() + ").");
    /* Check for the correct currency symbol */
    harness.check(currency.getSymbol(), CURRENCY_SYMBOL, "Currency symbol retrieval check (" +
                  currency.getSymbol() + ").");
    /* Check for the correct fraction digits */
    harness.check(currency.getDefaultFractionDigits(), FRACTION_DIGITS, "Currency fraction digits retrieval check (" +
                  currency.getDefaultFractionDigits() + ").");
    /* Check for the correct currency code from toString()*/
    harness.check(currency.toString(),ISO4217_CODE, "ISO 4217 currency code retrieval check (" + currency.toString() + ").");
  }
View Full Code Here

Examples of java.util.Currency

  private static final String INVALID_CURRENCY_CODE = "GNU";
  private static final String UK_CURRENCY_CODE = "GBP";

  public void test(TestHarness harness)
  {
    Currency currency;
    boolean threwException;

    /* Check getInstance with a null string */
    threwException = false;
    try
View Full Code Here

Examples of net.sf.ofx4j.domain.data.common.Currency

          double amount = formatter.parse(amountInReals).doubleValue();
          brazilianRealsAmount = brazilianRealsAmount + amount;

          if (amount == 0) {
            amount = formatter.parse(amountInDollars).doubleValue();
            transaction.setCurrency(new Currency());
            dolarsAmount = dolarsAmount + amount;
          }
          transaction.setAmount(-1 * amount);
          transaction.setMemo(description);

          transactions.add(transaction);
        }
        pattern = Pattern.compile("X\\s*(\\d+(\\.|,)\\d\\d\\d?\\d?)");
        matcher = pattern.matcher(line);
        while (matcher.find()) {
          exchangeRate = Float.parseFloat(matcher.group(1).replace(',', '.'));
        }
        pattern = Pattern.compile("Modalidade      : (.{30})");
        matcher = pattern.matcher(line);
        while (matcher.find()) {
          accountKey = matcher.group(1).trim();
        }
      }
    }

    for (Transaction transaction : transactions) {
      Currency currency = transaction.getCurrency();
      if (currency != null) {
        transaction.setCurrency(null);
        double temp = exchangeRate * transaction.getAmount();
        transaction.setAmount(temp);
      }
 
View Full Code Here

Examples of org.blueoxygen.postila.performanceanalysis.accountingrules.entity.Currency

    }
    if(hasErrors()){
      return INPUT;
    }
   
    Currency currency;
    if(getCurrency().getId() == null || "".equalsIgnoreCase(getCurrency().getId())) {
      currency = new Currency();
      logInfo = new LogInformation();
      logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
      logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
      msg = "Successfully Add "+getCurrency().getISOCurrencyCode();
    } else {
      currency = (Currency) manager.getById(Currency.class, getCurrency().getId());
      logInfo = currency.getLogInformation();
      msg = "Successfully Edit "+getCurrency().getISOCurrencyCode();
    }
   
    logInfo.setActiveFlag(getActive());
    logInfo.setLastUpdateBy(getCurrentUser().getId());
    logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
   
    currency.setLogInformation(logInfo);
    currency.setISOCurrencyCode(getCurrency().getISOCurrencyCode());
    currency.setSymbol(getCurrency().getSymbol());
    currency.setDescription(getCurrency().getDescription());
    currency.setStandardPrecision(getCurrency().getStandardPrecision());
    currency.setCostingPrecision(getCurrency().getCostingPrecision());
   
    manager.save(currency);
    setCurrency(currency);
    return SUCCESS;
  }
View Full Code Here

Examples of org.internna.iwebmvc.model.Currency

    @Autowired private DomainEntityParser domainEntityParser;

    @Test
    public void testParse() {
        assertNull(domainEntityParser.parse(null));
        Currency c = new Currency();
        assertEquals(c, domainEntityParser.parse(c));
        c.setId(baseDao.first(Currency.class).getId());
        c = (Currency) domainEntityParser.parse(c);
        assertNotNull(c.getCurrency());
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.Currency

    @Test
    public void testParse() {
        assertNull(amountParser.parse(null));
        Amount amount = new Amount();
        assertEquals(amountParser.parse(amount), amount);
        amount.setCurrency(new Currency());
        amount.getCurrency().setId(new UUID("000000aa000000aa000000aa000000aa"));
        assertEquals(amountParser.parse(amount), amount);
        Amount amount2 = new Amount();
        amount2.setCurrency(new Currency());
        amount2.getCurrency().setCurrency(java.util.Currency.getInstance("USD"));
        assertNotNull(amountParser.parse(amount2).getCurrency().getId());
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.Currency

    private CurrencyParser currencyParser;

    @Test
    public void testParse() {
        assertNull(currencyParser.parse(null));
        Currency currency = new Currency();
        currency.setId(new UUID("000000aa000000aa000000aa000000aa"));
        assertEquals(currencyParser.parse(currency), currency);
        Currency currency2 = new Currency();
        currency2.setCurrency(java.util.Currency.getInstance("EUR"));
        assertNotNull(currencyParser.parse(currency2).getId());
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.Currency

            f.setPhotos(new MultiDocument().addDocument(photoMary));
            dao.create(f, false);
            Calendar calendar = Calendar.getInstance();
            int num = 1000;
            boolean emitted = false;
            Currency eur = Currency.obtain("EUR", dao), usd = Currency.obtain("USD", dao);
            int count = 0;
            for (int i = 0; i < (30 + Math.round(Math.random() * 20)); i++) {
              emitted = !emitted;
                Order o = new Order();
                o.setAmount(new Amount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.