HomeBlogHow to truncate decimal value in a text in android ?Problem and SolutionsHow to truncate decimal value in a text in android ?By M.K. Verma · 4 May 2022try this String str = "10.289 Mbps"; String[] strArray = str.split(" "); Long roundedValue = Math.round(Double.valueOf(strArray[0])); String resultStr = roundedValue.toString() + " " + strArray[1]; System.out.println(resultStr);Share this:CommentsLeave a commentPost