Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Converter(arg1, arg2, arg3) {
- let first = Number(arg1);
- let second = String(arg2);
- let third = String(arg3);
- let conversion = second + third;
- if (conversion = 'mm' + 'm') {
- let result = first / 1000;
- console.log (result.toFixed(3));
- } else if (conversion === 'mm' + 'cm') {
- let result = first * 10;
- console.log (result.toFixed(3));
- } else if (conversion === 'cm' + 'm') {
- let result = first / 10;
- console.log (result.toFixed(3));
- } else if (conversion === 'cm' + 'mm') {
- let result = first * 10;
- console.log (result.toFixed(3));
- } else if (conversion === 'm' + 'mm') {
- let result = first * 1000;
- console.log(result.toFixed(3));
- } else if (conversion === 'm' + 'cm') {
- let result = first * 100;
- console.log(result.toFixed(3))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement