Try this:
String numberD = String.valueOf(d);
numberD = numberD.substring(numberD.indexOf("."));
Now this numberD variable will have value of 15
More Related Contents:
- Using bitwise operator to divide by 0 (Simulation of division by 0) [closed]
- What’s wrong with this input? [closed]
- How does the Java ‘for each’ loop work?
- Display Animated GIF
- Swing rendering appears broken in JDK 1.8, correct in JDK 1.7
- Why can’t we use ‘this’ keyword in a static method
- How can I convert a .jar to an .exe?
- Why does JPA have a @Transient annotation?
- RESTful call in Java
- Invoking a static method using reflection
- What is resource-ref in web.xml used for?
- How can I write a key listener to track all keystrokes in Java? [closed]
- How do I round a double to two decimal places in Java? [duplicate]
- Setter methods or constructors
- Create XML file using java
- What is the difference between Optional.flatMap and Optional.map?
- Java native method source code [duplicate]
- Ambari 2.7.5 installation failure on CentOS 7
- Java applet manifest – Allow all Caller-Allowable-Codebase
- How can I use hibernate with MS Access?
- Hot swapping in Spring Boot
- repository element was not specified in the POM inside distributionManagement element or in -DaltDep loymentRepository=id::layout::url parameter
- Why doesn’t changing the pre to the post increment at the iteration part of a for loop make a difference?
- Get the cell value as how it was presented in excel
- Change position of Google Maps API’s “My location” button
- What is a good 64bit hash function in Java for textual strings?
- How does long to int cast work in Java?
- Redirect stdin and stdout in Java
- How to get Date in the same format as String [duplicate]
- Java Swing Timer