本文整理汇总了Java中nl.strohalm.cyclos.utils.conversion.AmountConverter类的典型用法代码示例。如果您正苦于以下问题:Java AmountConverter类的具体用法?Java AmountConverter怎么用?Java AmountConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmountConverter类属于nl.strohalm.cyclos.utils.conversion包,在下文中一共展示了AmountConverter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPaymentDescription
import nl.strohalm.cyclos.utils.conversion.AmountConverter; //导入依赖的package包/类
/**
* Returns a description for a transfer
*/
private String getPaymentDescription(AccountFee fee, final AccountFeeLog feeLog, final Member member, final BigDecimal amount) {
final LocalSettings localSettings = settingsService.getLocalSettings();
final AmountConverter amountConverter = localSettings.getAmountConverter();
final UnitsConverter unitsConverter = localSettings.getUnitsConverter(fee.getAccountType().getCurrency().getPattern());
final CalendarConverter dateConverter = localSettings.getRawDateConverter();
final Map<String, Object> values = new HashMap<String, Object>();
final Amount amountValue = feeLog.getAmountValue();
if (amountValue.getType() == Amount.Type.PERCENTAGE) {
values.put("fee_amount", amountConverter.toString(amountValue));
} else {
values.put("fee_amount", unitsConverter.toString(amountValue.getValue()));
}
values.put("free_base", unitsConverter.toString(fee.getFreeBase()));
values.put("result", unitsConverter.toString(amount));
final Period period = feeLog.getPeriod();
values.put("begin_date", dateConverter.toString(period == null ? null : period.getBegin()));
values.put("end_date", dateConverter.toString(period == null ? null : period.getEnd()));
fee = fetchService.fetch(fee, AccountFee.Relationships.TRANSFER_TYPE);
return MessageProcessingHelper.processVariables(fee.getTransferType().getDescription(), values);
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:28,代码来源:ChargeAccountFeePollingTask.java
示例2: getAmountConverter
import nl.strohalm.cyclos.utils.conversion.AmountConverter; //导入依赖的package包/类
public AmountConverter getAmountConverter(final String unitsPattern) {
return new AmountConverter(getDecimalFormat(), unitsPattern);
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:LocalSettings.java
注:本文中的nl.strohalm.cyclos.utils.conversion.AmountConverter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论