truncate Summary Removes decimal digits and returns the integral part of a number. Usage public static double truncate(double x) Returns An integral number representing the specified value with its decimal digits removed. Parameters x The value to truncate. Description Removes decimal digits and returns the integral part of a number. Examples Basic Usage 1234import System; Console.log(Math.truncate(2.2d)); // 2Console.log(Math.truncate(3.3d)); // 3 Share HTML | BBCode | Direct Link