TZinovieva

Change Bureau

Jan 1st, 2023
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function changeBureau(input) {
  2.     let bitcoins = Number(input[0]);
  3.     let chY = Number(input[1]);
  4.     let commission = Number(input[2]);
  5.  
  6.     let bitcoinsInEuro = bitcoins * 1168 / 1.95;
  7.     let chYInEuro = (chY * 0.15 ) * 1.76 / 1.95;
  8.  
  9.     let sum = bitcoinsInEuro + chYInEuro;
  10.     let totalSum = sum - sum * commission / 100;
  11.  
  12.     console.log(`${totalSum.toFixed(2)}`);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment