public class Statics {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Double sum;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Double avg;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Double max ;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Double min ;
    private Long count = Long.valueOf(0);
}

Using this annotation: @JsonFormat(shape = JsonFormat.Shape.STRING) Solved my problem!

Answer from Nejatians on Stack Overflow
Discussions

java - Why double is converted to int in JSON string - Stack Overflow
I just coded to put an array of double values in the JsonObject. But, all my double values are converted to int values, when i print it. can someone help me understand what is happening behind? Ple... More on stackoverflow.com
🌐 stackoverflow.com
November 25, 2016
java - How can I convert each integer/double value to String from JSON data containing nested objects and arrays? - Stack Overflow
I want to convert each integer/double value to String present in json request before storing in MongoDB database. There can be multiple fields like amountValue in the json. I am looking for a gener... More on stackoverflow.com
🌐 stackoverflow.com
January 11, 2021
Json to Double type JAVA - Stack Overflow
In this approach, you will first get the String unitfactor value, which is 0.1, and then you will parse it to Double using its wrapper class. ... I cannot change json its coming from an api.Is there a way to remove quatation in java. More on stackoverflow.com
🌐 stackoverflow.com
Is that good idea to use monetary value as String in JSON?
Is your application going to perform calculations with the price? Then use BigDecimal. Is it going to display the price without any calculations? Then use String. More on reddit.com
🌐 r/java
60
14
December 13, 2017
🌐
MangoHost
mangohost.net › mangohost blog › java convert double to string – methods and examples
Java Convert Double to String – Methods and Examples
August 3, 2025 - When building REST APIs, you often need to format numerical data for JSON responses: import com.fasterxml.jackson.databind.ObjectMapper; import java.text.DecimalFormat; import java.util.HashMap; import java.util.Map; public class ApiResponseExample { public static void main(String[] args) throws Exception { double price = 99.999; double discount = 0.15; // Format for financial data (2 decimal places) DecimalFormat currency = new DecimalFormat("0.00"); DecimalFormat percentage = new DecimalFormat("0.0%"); Map
🌐
Stack Overflow
stackoverflow.com › questions › 65666272 › how-can-i-convert-each-integer-double-value-to-string-from-json-data-containing
java - How can I convert each integer/double value to String from JSON data containing nested objects and arrays? - Stack Overflow
January 11, 2021 - Is there any way to accomplish the result ? Or anything which can help to store documents in mongodb with attribute type as String ? ... Save this answer. ... Show activity on this post. You can use Json manipulation avaliable in "org.json.JSONObject" to convert Double value to Stirng .
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-convert-double-to-string
Java Convert double to String | DigitalOcean
August 3, 2022 - Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
Find elsewhere
🌐
GoLinuxCloud
golinuxcloud.com › home › programming › convert double to string in java
Convert double to String in Java | GoLinuxCloud
January 2, 2024 - Example : In this example, we concatenate blank string "" with double variable d. ... The + operator for string concatenation is straightforward and readable, making it a popular choice for simple conversions and displays. However, it's worth noting that repeated use of the + operator for string concatenation (especially inside loops) can be inefficient due to the immutability of strings in Java.
🌐
Lumbyfire
lumbyfire.ca › update › double-to-string-java
double to string java
September 25, 2024 - Additional Insight: Both methods function similarly, but using Double.toString() can sometimes improve code clarity by explicitly indicating that you're working with a double type. For more control over the formatting of the output string, Java offers String.format() or System.out.printf().
🌐
Baeldung
baeldung.com › home › java › java numbers › convert double to string, removing decimal places
Convert Double to String, Removing Decimal Places | Baeldung
January 8, 2024 - We can confidently use this approach when we’re guaranteed that the double value is within the range of an int. But if our value exceeds that, casting won’t work like we’d want. Now, the remaining approaches aren’t as limited as casting, but they have their own nuances. For example, another approach is to use the format method of the String class.
🌐
C# Corner
c-sharpcorner.com › home › technologies › java › convert and display double value as string in java
Convert and Display Double Value as String in Java
When converting a double to a String in Java, using Double.toString() should typically work without any issues.
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › convert double to string in java
Turning Double into String: Java Techniques
October 1, 2026 - We'll explore how to prevent this and get a non-exponential string representation. Java Double to String without Decimal: Sometimes, we need to convert a double into a string but without any decimal places.
🌐
Apps Developer Blog
appsdeveloperblog.com › home › java › java conversion › convert double to string in java
Convert Double to String in Java - Apps Developer Blog
March 21, 2023 - The following are some of the formatting options available in Java: You can specify the number of decimal places to display for a double value using the %f format specifier. For example, the pattern %.2f will display a double value with two decimal places. Here’s an example: double d = 123.456; String s = String.format("%.2f", d); System.out.println(s);
🌐
BeginnersBook
beginnersbook.com › 2015 › 05 › java-double-to-string
Java – Convert double to string example
November 14, 2016 - This method returns the string representation of the double argument. public class JavaExample{ public static void main(String args[]){ //double value double dnum = 99.9999; //convert double to string using valueOf() method String str = String.valueOf(dnum); //displaying output string after ...
🌐
Java Guides
javaguides.net › 2018 › 08 › java-convert-double-to-string-example.html
Convert Double to String in Java
June 15, 2024 - In this article, we will show you how to convert Java double to String code examples. Performing conversion from wrapper class Double or primitive type double to String is a common scenario when programming with Core Java.
🌐
CodeGym
codegym.cc › java blog › java numbers › java convert double to string
Java Convert Double to String
September 28, 2023 - “Double” is a wrapper class in Java that stores the primitive type of “double”. It comes with a bunch of useful functions for “double” manipulation and computations. For example, you can convert Java double to string quite effectively using its wrapper object.
🌐
Scaler
scaler.com › home › topics › convert double to string in java
Convert double to String in Java - Scaler Topics
January 11, 2024 - The + sign concatenates the string to the number changing it to string type. ... Example: The following example helps us add numbers to string. The + operator concatenates the string with the number. ... Java program can be converted from double to string using the String.format() method.