• Post Reply Bookmark Topic Watch Topic
  • New Topic

howto get different btw 2 number ?  RSS feed

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, good day for everyone , i have a question , it should be simple ,

if i want to get different btw 2 numbers like

totalDifferent = number1 - number2 , and number1 = 10 , number2 = 100

so as expected, totalDifferent is -90 , but what i need is just 90 without the minus sign , how to i do that ? thank you
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out java.lang.Math's abs methods!
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thks, jeff , it work
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!