当前位置: 首页>>代码示例>>Java>>正文


Java MonetaryAmount.multiply方法代码示例

本文整理汇总了Java中javax.money.MonetaryAmount.multiply方法的典型用法代码示例。如果您正苦于以下问题:Java MonetaryAmount.multiply方法的具体用法?Java MonetaryAmount.multiply怎么用?Java MonetaryAmount.multiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.money.MonetaryAmount的用法示例。


在下文中一共展示了MonetaryAmount.multiply方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import javax.money.MonetaryAmount; //导入方法依赖的package包/类
public static void main(String[] args) {
    CurrencyUnit currency = Monetary.getCurrency("BRL");
    MonetaryAmount money = Money.of(100, currency);
    Number number = 20;
    MonetaryAmount divideResult = money.divide(number);//BRL 5
    MonetaryAmount remainderResult = money.remainder(30);//BRL 10
    MonetaryAmount resultMultiply = money.multiply(5);//BRL 500
}
 
开发者ID:otaviojava,项目名称:money-api-book-samples,代码行数:9,代码来源:ArithmeticOperations2.java

示例2: apply

import javax.money.MonetaryAmount; //导入方法依赖的package包/类
/**
 * Gets the percentage of the amount.
 * <p>
 * This returns the monetary amount in percent. For example, for 10% 'EUR
 * 2.35' will return 0.235.
 * <p>
 * This is returned as a {@code MonetaryAmount}.
 *
 * @return the percent result of the amount, never {@code null}
 */
@Override
public MonetaryAmount apply(MonetaryAmount amount) {
	Objects.requireNonNull(amount, "Amount required.");
	return amount.multiply(percentValue);
}
 
开发者ID:JavaMoney,项目名称:jsr354-ri-bp,代码行数:16,代码来源:PercentOperator.java

示例3: apply

import javax.money.MonetaryAmount; //导入方法依赖的package包/类
/**
 * Gets the permil of the amount.
 * <p>
 * This returns the monetary amount in permil. For example, for 10% 'EUR
 * 2.35' will return 0.235.
 * <p>
 * This is returned as a {@code MonetaryAmount}.
 *
 * @return the permil result of the amount, never {@code null}
 */
@Override
public MonetaryAmount apply(MonetaryAmount amount) {
	Objects.requireNonNull(amount, "Amount required.");
	return amount.multiply(permilValue);
}
 
开发者ID:JavaMoney,项目名称:jsr354-ri-bp,代码行数:16,代码来源:PermilOperator.java


注:本文中的javax.money.MonetaryAmount.multiply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。