Guest User

Untitled

a guest
Jan 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. function parseData(response, value : string = '1') : string {
  2. // Data not acquired
  3. if (!response) {
  4. return;
  5. }
  6.  
  7. return Object.keys(response.data).map(x => {
  8. return Object.keys(response.data[x]).map(i => {
  9. const finalValue : number = parseFloat(value) * parseFloat(response.data[x][i]);
  10.  
  11. return `*${value} ${x}* to *${i}*: \`${finalValue.toFixed(2)}\``;
  12. }).join('\n');
  13. }).join('\n\n');
  14. }
Add Comment
Please, Sign In to add comment