Linked Questions
67 questions linked to/from How to nicely format floating numbers to string without unnecessary decimal 0's
-1 votes
1 answer
100 views
How do I get rid of trailing zero? [closed]
I'm building a calculator app which take up math expressions, parses it and displays the results, for that I use Javaluator. Something like: String expression = "(2^3-1)"; Double result = new ...
0 votes
1 answer
70 views
Why when I try to store this big number inside a double I obtain this strange result into a Java application?
I have the following problem trying to store the correct output of this SQL query into a double variable into a Java applcation. So I have this SQL query: SELECT sum(anagraficaEdificio.imp_tot_ind - ...
0 votes
2 answers
120 views
Conditional NumberFormatter?
Is there a way to make a NumberFormatter that does the following: If the Double is a whole number like 5.0, display "5" If the Double is a decimal like 5.6, display "5.6"
0 votes
1 answer
62 views
No pointation on a Double value
The following Code private double roundTheReading(double toRoundValue) { double roundetValue = 0; if (formatter == null){ DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs....
1 vote
1 answer
47 views
Java: Simple format standard for various precision data
I'm trying to format output for user/report appeal, and there are two criteria I'm finding to be in a bit of conflict. First, the decimal values should line up (format on "%12.10f", predicted integer ...
0 votes
1 answer
36 views
Decimal values add Zeros and numbers [duplicate]
I'm building an unit converter app, when I want a value sometimes the answer comes with zeros or nines, like an answer should be 2.6789 it comes out 2.67899999999 or 2.6789000000 and I don't want this ...
0 votes
0 answers
21 views
How to handle Measurement unit to string [duplicate]
I my application there's four types of Measurement unit. kg Height (cm) Width (cm) Length (cm) So I'm putting this all with a Double as it should, but when I Try to show this on TextView if the value ...