android java need to use tenth place in equation -


ok im new android , java im trying build first app , im stuck here part of code far

private void calculate() {         year = double.parsedouble(edityear.gettext().tostring());         year = year / 12;         year = year * 10;         year = math.round(year);         year = year / 10; 

now need take tenths place out , use pick page im going show.

so if started 1985 end 165.4... want take 4 , use in this

if (year == 4)  {    setcontentview(r.layout.splash); } 

thanks help

calculate(); int whatyouneed = (year * 10) % 10; 

% getting rest of division result, 14 % 10 4


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -