Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java string to decimal

String strDecimal = "0.00000008880000";
double f = Double.parseDouble(strDecimal);
System.out.println(f);
System.out.println(String.format("%.7f", f));
System.out.println(String.format("%.9f", new BigDecimal(f)));
System.out.println(String.format("%.35f", new BigDecimal(f)));
System.out.println(String.format("%.2f", new BigDecimal(f)));
Comment

PREVIOUS NEXT
Code Example
Java :: inputstream to string java 
Java :: java split string 
Java :: get last index of array java 
Java :: kotlin variable in string 
Java :: onclick listener android 
Java :: public String toString() { 
Java :: how to check the lines in a file java scanner 
Java :: java copy array 
Java :: get time android 
Java :: remove fragment from backstack 
Java :: Android dark theme programmatically 
Java :: android studio change title bar text 
Java :: date difference in minutes java 
Java :: android studio listview arrayadapter 
Java :: char to int 
Java :: 12 hours to 24 hours java 
Java :: convert int to ascii java 
Java :: Caused by: java.lang.RuntimeException: No installed build tools found. Install the Android build tools version 19.1.0 or higher. 
Java :: reading from a text file in java 
Java :: java method return list 
Java :: change string into binary uding java 
Java :: printing 2d array in java 
Java :: springdoc 
Java :: timestamp to date java 
Java :: JAVA Display Sum of n Natural Numbers 
Java :: java read next line 
Java :: java arraylist deep copy 
Java :: arraylist syntax in java 
Java :: primitive data types in java 
Java :: datatypes in java 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =