convert number to int code example

Example 1: get the whole value of a number javascript

var value = 2.9802453587962963;
var wholeNum = Math.floor(value);
console.log(wholeNum);  // output ==> 2

Example 2: numberlong to int

NumberLong('yourValue').valueOf().toString();

Example 3: how do you set an integer to a number in java

int num = 9;

Example 4: how to convert int into Integer

public class IntToIntegerExample {
public static void main(String[] args) {
int i = 10;
Integer intObj = new Integer(i);
System. out. println(intObj);