Mega Code Archive

 
Categories / Java Tutorial / Internationalization
 

Formatting and Parsing Locale-Specific Currency

import java.text.NumberFormat; import java.util.Locale; public class Main {   public static void main(String[] argv) throws Exception {     // Format     Locale locale = Locale.GERMANY;     String string = NumberFormat.getCurrencyInstance(locale).format(123.45);   } } // 123,45 DM