CurrencyConverter.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import java.text.DecimalFormat;
  2. public class CurrencyConverter {
  3. public static double ConvertDollarToEuro(double dolla){
  4. DecimalFormat aaa = new DecimalFormat("##.00");
  5. return Double.valueOf(aaa.format(dolla * 0.94));
  6. }
  7. public static double EuroToDollar(double euro){
  8. DecimalFormat df = new DecimalFormat("##.00");
  9. return Double.valueOf(df.format(euro * 1));
  10. }
  11. public static double EuroToBritishPound(double euro){
  12. DecimalFormat df = new DecimalFormat("##.00");
  13. return Double.valueOf(df.format(euro * 0.82));
  14. }
  15. public static double BritishPoundToRupee(double britishPound){
  16. DecimalFormat df = new DecimalFormat("##.00");
  17. return Double.valueOf(df.format(britishPound * 68.32));
  18. }
  19. public static double RupeeToCanadianDollar(double ruppee){
  20. DecimalFormat df = new DecimalFormat("##.00");
  21. return Double.valueOf(df.format(ruppee * 1.32));
  22. }
  23. public static double canadianToSingapore(double canadianDollar){
  24. DecimalFormat df = new DecimalFormat("##.00");
  25. return Double.valueOf(df.format(canadianDollar * 1.43));
  26. }
  27. public static double SingaporeToSwiss(double singapore){
  28. DecimalFormat df = new DecimalFormat("##.00");
  29. return Double.valueOf(df.format(singapore * 1.01));
  30. }
  31. public static double SwissToMalaysian(double Swiss){
  32. DecimalFormat df = new DecimalFormat("##.00");
  33. return Double.valueOf(df.format(Swiss * 4.47));
  34. }
  35. public static double MalaysianToJapaneseYen(double malaysian){
  36. DecimalFormat df = new DecimalFormat("##.00");
  37. return Double.valueOf(df.format(malaysian * 115.84));
  38. }
  39. public static double JapaneseYenToChinese(double japan){
  40. DecimalFormat df = new DecimalFormat("##.00");
  41. return Double.valueOf(df.format(japan * 6.92));
  42. }
  43. }