-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters