Celsius To Fahrenheit Converter Using JavaScript
Submitted by alpha_luna on Tuesday, April 12, 2016 - 12:19.
This is a simple tutorial that we are going to learn today. And it's called Celsius To Fahrenheit Converter Using JavaScript. If you want to do this manually. First, you have the method to convert the Celsius to Fahrenheit. You have to take time for solving.
But if you have this program, you don't need to do this manually to get the Celsius to Fahrenheit.
Kindly type a value in the box then it will automatically view the result.
JavaScript
This is the script to get the result of Celsius to Fahrenheit.
HTML
This is the HTML code to input the user the value to convert and to see automatically the result.
So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
- <script type="text/javascript" src="angular.min.js"></script>
- <script>
- var app = angular.module('celsiusTofahrenheit', []);
- app.filter('single_inDecimal', function($filter) {
- return function(input) {
- if (isNaN(input)) return input;
- return Math.round(input * 10) / 10;
- };
- });
- app.filter('setDecimal', function($filter) {
- return function(input, places) {
- if (isNaN(input)) return input;
- var factor = "1" + Array(+(places > 0 && places + 1)).join("0");
- return Math.round(input * factor) / factor;
- };
- });
- app.controller('Ctrl', function($scope) {
- $scope.val = 1.56;
- });
- </script>
Add new comment
- 44 views