What you could do is force it to divide a
and b
as doubles thus:
int x = (int) (((double) a / (double) b) * 100);
More Related Contents:
- How to compare value 3.0.1 with 3.0.2 where these two numeric values are in String ? [closed]
- FirebaseListAdapter not pushing individual items for chat app – Firebase-Ui 3.1
- Inner class can access but not update values – AsyncTask
- Unable to list target platforms. Please make sure the android sdk path is correct
- Is it legal to call the start method twice on the same Thread?
- NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
- Variable is accessed within inner class. Needs to be declared final
- How to add image in a TextView text?
- How to connect via HTTPS using Jsoup?
- FirebaseApp with name [DEFAULT] doesn’t exist
- How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain
- Firebase Firestore get data from collection
- How to redirect a user to a specific activity in Cloud Firestore?
- Capture screen of GLSurfaceView to bitmap
- how to convert rgb color to int in java
- Apache HttpClient Digest authentication
- Android studio – Failed to complete gradle execution – error in opening zip file
- DeadObjectException on android app
- How to parse or split URL Address in Java?
- Android: How to run asynctask from different class file?
- NoClassDefFoundError on external library project for Android
- Theme Error – how to fix?
- Date format conversion Android
- Scroll up does not work with SwipeRefreshLayout in Listview
- How do I get a button to open another activity?
- Android BroadcastReceiver onReceive Update TextView in MainActivity
- Android – Generate CSV file from table values
- How to iterate through SparseArray?
- Can one class extend two classes?
- BroadcastReceiver not receiving download complete action