-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava-math.js
More file actions
42 lines (26 loc) · 905 Bytes
/
Copy pathjava-math.js
File metadata and controls
42 lines (26 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const score = 10
const bal = new Number(10.02)
// toFixed(x) = fixes the precision of decimal numbers
// console.log(bal.toFixed(1));
//toPrecision(s) = returns a string with value rounded off to 's' significant digits.
// console.log(12.49.toPrecision(2));
//toLocaleString('en-IN') = converts number intro string with commas
//Math.round(num) = Round off a number
//Math.ceil() , Math.floor() ,Math.sqrt(), Math.pow(), Math.min(array), Math.max(array)
//Math.random() = between 0 and 1 (inclusive.)
const min = 10
const max = 20
//formula for specific range
//Math.random*(max-min+1)+min
//dates
let PresDate = new Date()
// console.log(PresDate.toISOString());
let Stamp = Date.now()
// console.log(Stamp);
// Time in seconds
console.log(Math.floor(Stamp/1000));
let MyCreatedDate = new Date("15-05-2023")
//customisation
MyCreatedDate.toLocaleString('default',{
month: "long"
})