📄 converterbean.java
字号:
/* * Copyright 2007 Sun Microsystems, Inc. * All rights reserved. You may not modify, use, * reproduce, or distribute this software except in * compliance with the terms of the License at: * http://developer.sun.com/berkeley_license.html */package converter.ejb;import java.math.BigDecimal;import javax.ejb.Stateless;/** * This is the bean class for the ConverterBean enterprise bean. * Created Jan 20, 2006 1:14:27 PM * @author ian */@Statelesspublic class ConverterBean implements converter.ejb.Converter { private BigDecimal euroRate = new BigDecimal("0.0070"); private BigDecimal yenRate = new BigDecimal("112.58"); public BigDecimal dollarToYen(BigDecimal dollars) { BigDecimal result = dollars.multiply(yenRate); return result.setScale(2, BigDecimal.ROUND_UP); } public BigDecimal yenToEuro(BigDecimal yen) { BigDecimal result = yen.multiply(euroRate); return result.setScale(2, BigDecimal.ROUND_UP); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -