Skip to content

Commit

Permalink
numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
ARQUM21 committed May 1, 2024
1 parent d5d46c8 commit c6c4b30
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
31 changes: 31 additions & 0 deletions Numbers/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//*Round*//

var number = 5.0
console.log(Math.round(number));

//*floor*//

var number = 2.3
console.log(Math.floor(number));

//*ceil*//

var number = 4.6
console.log(Math.ceil(number));


//string ko number me convert krna
//1. +lagdo phele
//2. Number () ke function me de do
//3. parseInt () ye decimal ko convert ni krta
//4. parseFloat () ye decimal ko bi covert krta hn

// console.log(typeof number);
// console.log(typeof number.toString());

var price = "340a45.4";
console.log("parseInt", parseFloat(price));

//decimal ki length ko control krne ke liye
var divide = 10 / 3;
console.log(divide.toFixed(2));
13 changes: 13 additions & 0 deletions Numbers/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=>, initial-scale=1.0">
<title>Numbers</title>
</head>
<body>
<h1>Numbers</h1>

<script src="app.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ <h1 style="text-align: center;">Learning Javascript</h1>

<a href="Changing Case/index.html">Changing Case</a><br><br>

<a href="Assignment/index.html">Assignment</a>
<a href="Assignment/index.html">Assignment</a><br><br>

<a href="Numbers/index.html">Numbers</a>
</body>
</html>

0 comments on commit c6c4b30

Please sign in to comment.