I'm reading a JSON object, and I get the data in TextView
.
However, the value of String Preco
when the price has a zero in the second decimal place, it does not print in TextView
.
For example: 9.20
displays 9.2
. I tried some functions, but to no avail.
Can someone help me ?
@Override
protected void onPostExecute(String[] jsonWinthor) {
txtCodProd.setText(jsonWinthor[0]);
txtDescProduto.setText(jsonWinthor[1]);
txtValor.setText(jsonWinthor[2]);
txtSifrao.setVisibility(View.VISIBLE);
}
}
JSON object read:
{"Codigo":78,"Descricao":"BANDEJA PINT.TIGRE 1308","Preco":9.20,"CodigoBarra":"78"}