Posts by Joaquim Cavalcanti • 1 point
1 post
-
0
votes4
answers295
viewsA: take only the decimal of a double
You can also use Regex to extract this value public int decimal(double num) { Pattern pattern = Pattern.compile("(?<=[\\.])[0-9]+"); Matcher matcher = pattern.matcher(Double.toString(num));…
javaanswered Joaquim Cavalcanti 1