无论我做什么,我都会得到“中国:?100.00”。我的代码出了什么问题?
public static void main(String[] args)
{
/* Read input */
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
/* Create NumberFormats using Locales */
NumberFormat china = NumberFormat.getCurrencyInstance(Locale.CHINA);
/* Print output */
System.out.println("China: " + china.format(payment));
}发布于 2020-01-13 19:28:36
试试这个:
china=DecimalFormat.getCurrencyInstance(Locale.CHINA).format(100.10);https://stackoverflow.com/questions/43995043
复制相似问题