For example, I am trying to save the number 1.86 in CloudFirestore, but the number 1.8600000143051147 appears in the console. Is this a normal mechanism or am I making a mistake?
In application:
In Console:
Code:
String name = selectedProduct.getName();
float carbohydrates = Float.parseFloat(textViewCarbohydratesSaveProduct.getText().toString().split("\\ ")[1]);
float protein = Float.parseFloat(textViewProteinSaveProduct.getText().toString().split("\\ ")[1]);
float fat = Float.parseFloat(textViewFatSaveProduct.getText().toString().split("\\ ")[1]);
float weight = Float.parseFloat(editTextCurrentWeightSaveProduct.getText().toString());
float calories = Float.parseFloat(textViewCaloriesSaveProduct.getText().toString().split("\\ ")[1]);
Product newProduct = new Product(name, carbohydrates, protein, fat, weight, calories);
firebaseFirestore.collection("Users").document(currentUser)
.collection("Type of Meal").document(typeOfMeal)
.collection("Date of breakfast").document(date).set(newProduct);