int number = 6321;
int rounded = (number / 100) * 100;
int number = 6321;
int rounded = (number / 100) * 100;
double abc_1 = 2495;
double abc_1_m = abc_1 - abc_1 % 100;
double abc_2 = 6321;
double abc_2_m = abc_2 - abc_2 % 100;
double abc_3 = 123456;
double abc_3_m = abc_3 - abc_3 % 100;
double abc_3 = 123456;
double abc_3_m = abc_3 - abc_3 % 1000;
You need to subtract off the remainder that is left over when you divide by 100.That's exactly what integer division does ; )
Title | # Comments | Views | Activity |
---|---|---|---|
Log4Net custom Appender not being fired. | 5 | 41 | |
.NET Error | 7 | 41 | |
Image(2) | 3 | 21 | |
Connect to a database from Excel using JDBC instead of ODBC | 3 | 22 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!