lawnq
Media Outreach Manager
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
Related Code: Celsius To Fahrenheit Converter
Good Day!!!
Yesterday, I worked a program and it's called Celsius To Fahrenheit Converter. Today, we create another converter, and it's called Fahrenheit To Celsius Converter. If you want to do this manually. First, you have the method to convert the Fahrenheit to Celsius. You have to take time for solving.
But if you have this program, you don't need to do this manually to get the Fahrenheit to Celsius.
Kindly type a value in the box then it will automatically view the result.
HTML
This is the HTML code to input the user the value to convert and to see automatically the result.
JavaScript
This is the script to get the result of Fahrenheit to Celsius.
CSS
And, this is the style.
Related Code: Celsius To Fahrenheit Converter
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.
Download
Good Day!!!
Yesterday, I worked a program and it's called Celsius To Fahrenheit Converter. Today, we create another converter, and it's called Fahrenheit To Celsius Converter. If you want to do this manually. First, you have the method to convert the Fahrenheit to Celsius. You have to take time for solving.
But if you have this program, you don't need to do this manually to get the Fahrenheit to Celsius.
Kindly type a value in the box then it will automatically view the result.
HTML
This is the HTML code to input the user the value to convert and to see automatically the result.
- <center
>
- <h3
>
Fahrenheit To Celsius Converter</
h3
>
- <div
ng-app=
"fahrenheitTocelsius"
>
- <p
>
Temperature in Fahrenheit:</
p
>
- <hr
/
>
- <input
type
=
"number"
step=
"1"
autofocus=
"autofocus"
ng-model=
"code_fahrenheit"
maxlength
=
"5"
size
=
"3"
/
>
- <hr
/
>
- <p
>
The temperature in Fahrenheit is <b
style
=
"color:blue;"
>
{{ code_fahrenheit }}°
F </
b
>
its equivalent to Celsius is <b
style
=
"color:blue;"
>
{{ (code_fahrenheit - 32) * 5/9 | setting_Decimal:1}}°
C</
b
>
.</
p
>
- </
div
>
- </
center
>
JavaScript
This is the script to get the result of Fahrenheit to Celsius.
- <
script type=
"text/javascript"
src=
"angular.min.js"
></
script>
- <
script>
- var
app1 =
angular.module
(
'fahrenheitTocelsius'
,
[
]
)
;
- app1.filter
(
'single_inDecimal'
,
function
(
$filter)
{
- return
function
(
input)
{
- if
(
isNaN(
input)
)
return
input;
- return
Math
.round
(
input *
10
)
/
10
;
- }
;
- }
)
;
- app1.filter
(
'setting_Decimal'
,
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;
- }
;
- }
)
;
- app1.controller
(
'Control_converter'
,
function
(
$scope)
{
- $scope.val
=
1.56
;
- }
)
;
- </
script>
CSS
And, this is the style.
- <style type=
"text/css"
>
- p {
- color
:
red
;
- font-family
:
"helvitica"
;
- font-style
:
bold
;
- font-size
:
18px
;
- }
- h3 {
- color
:
blue
;
- font-family
:
"helvitica"
;
- font-style
:
bold
;
- font-size
:
20px
;
- }
- input[
type=
'number'
]
{
- border
:
skyblue
3px
solid
;
- font-family
:
"helvitica"
;
- font-size
:
18px
;
- color
:
red
;
- font-style
:
bold
;
- width
:
100px
;
- text-align
:
center
;
- }
- hr {
- width
:
500px
;
- border
:
blue
1px
solid
;
- }
- </style>
Related Code: Celsius To Fahrenheit Converter
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.
Download
You must upgrade your account or reply in the thread to view hidden text.