I want the price to be in Euros €, what do i need to change with the code below?
I have it in dollars so far
DecimalFormat dollars = new DecimalFormat( "$0.00" );
I want the price to be in Euros €, what do i need to change with the code below?
I have it in dollars so far
DecimalFormat dollars = new DecimalFormat( "$0.00" );
Unless, I'm missing something; you could change this
DecimalFormat dollars = new DecimalFormat( "$0.00" );
to
DecimalFormat euros = new DecimalFormat( "€0.00" ); // <-- euros not dollars.
you can even do it this way
Locale italian = new Locale("it", "IT", "EURO");
Locale.setDefault(italian);
NumberFormat nf = NumberFormat.getCurrencyInstance();
System.out.println(nf.format(123));