I was participating in one of our Android projects, and while testing I discovered, that our program acted weird — app displayed one value, but acted like the value was different. The value was 1.45, and our Java Android app displayed 1.4 instead of 1.5. The source looked something like: double d = 1.45; String …
Continue reading “String.format in Java has weird rounding by default”