Examples of Money


Examples of com.google.checkout.sdk.domain.Money

   *    {@code makeMoney(new BigDecimal("0.01"))} represents 1 US cent, for
   *    instance.
   * @return A Money object of the correct {@code value}.
   */
  public Money makeMoney(BigDecimal value) {
    Money money = new Money();
    money.setCurrency(getMerchantCurrencyCode());
    money.setValue(Utils.normalize(value));

    return money;
  }
View Full Code Here

Examples of com.google.code.timetrail.backend.Money

    engine = new Engine();
    fluxCapacitor = new FluxCapacitor();
    fuelCell = new FuelCell();
    hullPart = new HullPart();
    money = new Money();
    timeBulletBill = new TimeBulletBill();
    timeSuit = new TimeSuit();

    control = new Control();
    ArrayList<Person> members = new ArrayList<Person>();
View Full Code Here

Examples of com.google.gdata.data.extensions.Money

    System.out.printf("\t\t\tOverall: %.2f%%\n", portfolioData.getReturnOverall() * 100.0);
    if (portfolioData.getCostBasis() == null) {
      System.out.println("\t\tCost Basis not specified");
    } else {
      for (int i = 0; i < portfolioData.getCostBasis().getMoney().size(); i++) {
        Money m = portfolioData.getCostBasis().getMoney().get(i);
        System.out.printf("\t\tThis portfolio cost %.2f %s.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
    if (portfolioData.getDaysGain() == null) {
      System.out.println("\t\tDay's Gain not specified");
    } else {
      for (int i = 0; i < portfolioData.getDaysGain().getMoney().size(); i++) {
        Money m = portfolioData.getDaysGain().getMoney().get(i);
        System.out.printf("\t\tThis portfolio made %.2f %s today.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
    if (portfolioData.getGain() == null) {
      System.out.println("\t\tTotal Gain not specified");
    } else {
      for (int i = 0; i < portfolioData.getGain().getMoney().size(); i++) {
        Money m = portfolioData.getGain().getMoney().get(i);
        System.out.printf("\t\tThis portfolio has a total gain of %.2f %s.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
    if (portfolioData.getMarketValue() == null) {
      System.out.println("\t\tMarket Value not specified");
    } else {
      for (int i = 0; i < portfolioData.getMarketValue().getMoney().size(); i++) {
        Money m = portfolioData.getMarketValue().getMoney().get(i);
        System.out.printf("\t\tThis portfolio is worth %.2f %s.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
  }
View Full Code Here

Examples of com.knowgate.math.Money

  @Validate(converter=BigDecimalTypeConverter.class)
  public BigDecimal getVatAlt() {
    if (getVat()==null) return null;
    for (String c : currencies) {
      if (!"EUR".equalsIgnoreCase(c)) {
        return new Money(getVat(), CurrencyCode.EUR).convertTo(c).round2();
      }
    }
    return null;
  }
View Full Code Here

Examples of com.projity.datatype.Money

    Object value;
    if (Money.class.equals(clazz)){
      try {
        //this should be handled with an ObjectConverter in the
        //editor specific context
        value=new Money(component.getText());
      } catch (NumberFormatException e) {
        value=null; //to force an error popup
      }
    }else value=FieldConverter.fromString(component.getText(),clazz);
    return value;
View Full Code Here

Examples of com.wesabe.api.util.money.Money

  public static final Money twoEuros = new Money(decimal("2.00"), EUR);
  public static final Money oneKroner = new Money(decimal("1.00"), NOK); // eat it, DHH
  public static final Money sixKroners = new Money(decimal("6.00"), NOK);
 
  public static Money money(String amount, Currency currency) {
    return new Money(new BigDecimal(amount), currency);
  }
View Full Code Here

Examples of games.stendhal.server.entity.item.Money

  public static boolean canPlayerAffordTradingFee(Player player, int price) {
    BigDecimal fee = calculateFee(player, price);
    List<Item> allEquipped = player.getAllEquipped("money");
    int ownedMoney = 0;
    for(Item item : allEquipped) {
      Money m = (Money) item;
      ownedMoney += m.getQuantity();
    }
    return fee.intValue() <= ownedMoney;
  }
View Full Code Here

Examples of junit.samples.money.Money

    }

    @Test
    public void testSimpleMultiply() {
        // [14 CHF] *2 == [28 CHF]
        Money expected = new Money(28, "CHF");
        assertEquals(expected, f14CHF.multiply(2));
    }
View Full Code Here

Examples of junit.samples.money.Money

    }

    @Test
    public void testSimpleNegate() {
        // [14 CHF] negate == [-14 CHF]
        Money expected = new Money(-14, "CHF");
        assertEquals(expected, f14CHF.negate());
    }
View Full Code Here

Examples of junit.samples.money.Money

    }

    @Test
    public void testSimpleSubtract() {
        // [14 CHF] - [12 CHF] == [2 CHF]
        Money expected = new Money(2, "CHF");
        assertEquals(expected, f14CHF.subtract(f12CHF));
    }
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.