currency.java
来自「一个java写的加密算法」· Java 代码 · 共 33 行
JAVA
33 行
/* * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */package samples.webapps.bookstore.util;import java.text.NumberFormat;import java.util.*;public class Currency { private Locale locale; private double amount; public Currency() { locale = null; amount = 0.0; } public synchronized void setLocale(Locale l) { locale = l; } public synchronized void setAmount(double a) { amount = a; } public synchronized String getFormat() { NumberFormat nf = NumberFormat.getCurrencyInstance(locale); return nf.format(amount); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?