I have written this block its working fine but is it optimized? I am getting currency in format 1.234,25 .
public static String convertCurrency(String value, String exchangeCurrencyId)
{
java.text.NumberFormat format = null;
value = value.replaceAll("\\.", ",");
char[] chars = value.toCharArray();
chars[value.lastIndexOf(',')] = '.';
value = new String(chars);
value = value.replaceAll(",", "");
Double price = Double.valueOf(value);
price = price * (50); //exchange rate
return price.toString();
}