Questions tagged as 'double'

1
answer

Why does the variable x of double always print the same value WRONG in scientific notation?

In this first example I would like to know why the variable x handles double, when it is formatted by the function "printf ()" does not display the value correctly, and every time the value is the same. #include <stdio.h> int main(){...
asked by 11.10.2017 / 00:53
2
answers

How do I set a TextView with a DOUBLE variable?

I'm trying to set the variable txtMedia1 to the value of the variable media1 . I did this, but Android Studio indicates that I have to change txtMedia1 to double or media1 to TextView : package com.app.j...
asked by 24.01.2017 / 17:19
1
answer

Check double - Java

I am not able to do this check already tried everything, but it always gives me this error:    java.lang.NumberFormatException: Invalid double: "" If anyone can help, thank you. package com.calculadora; import android.content.DialogInt...
asked by 24.03.2016 / 18:42
0
answers

Format Double with two house

I am dealing with a .csv file with an id , value (1,214.45) and need to format a final sum of these values with only two boxes after the comma. p> Developed the following code snippet: 'DecimalFormat df = new DecimalFormat("0.##"...
asked by 18.04.2018 / 07:14
0
answers

Fill double zero to the left in java

I would like to know how do I format a double with two boxes to the left of the dot and two to the right of the dot. Example: I have double 1.1 I want it to be formatted for 01.10; entry: 10.1 / 1.05 Output: 10.01 / 01.05     
asked by 29.04.2016 / 21:17
1
answer

Result 0.0 - even with typecast or swapping variable types

I have this method in the secondary class to calculate the median of a vector: public class Funcoes { .... public void setMediana(int[] valores) { double med; Arrays.sort(valores); int meio = valores.length / 2;...
asked by 02.11.2017 / 17:17