Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi29400 authored Jan 25, 2024
1 parent 7f71b60 commit 6204a41
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion js/script.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@

let celsius = document.getElementById("celsius");
let fahrenheit = document.getElementById("fahrenheit");

function celToFar(){
let output = ( parseFloat(celsius.value) * 9/5 ) + 32;
fahrenheit.value = parseFloat(output.toFixed(2));
}

function farToCel(){
let output = ( parseFloat(fahrenheit.value) - 32) * 5/9;
celsius.value = parseFloat( output.toFixed(2));
console.log(output);
}

0 comments on commit 6204a41

Please sign in to comment.