import java.text.NumberFormat;
import java.util.Locale;
public class Currency {
public static void main(String[] args) {
Locale locale = Locale.GERMANY;
String string = NumberFormat.getCurrencyInstance(locale).format(123.45);
System.out.println(string);
}
}
Output
123,45 €
import java.util.Locale;
public class Currency {
public static void main(String[] args) {
Locale locale = Locale.GERMANY;
String string = NumberFormat.getCurrencyInstance(locale).format(123.45);
System.out.println(string);
}
}
Output
123,45 €
No comments:
Post a Comment