aspose file tools*
The moose likes Beginning Java and the fly likes Trying to look at only at the number in the Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to look at only at the number in the "ones" digit place" Watch "Trying to look at only at the number in the "ones" digit place" New topic
Author

Trying to look at only at the number in the "ones" digit place

Paul Hobson
Greenhorn

Joined: Oct 29, 2003
Posts: 4
I have a some numbers, all of them ranging from 1-100. Is there a code to look at only the number in the one's place. like for the number 96; make it only look at the number six. like i want to make a variable equal to whatever number is in the one's place. if anyone knows how to do this it would be greatly appreciated.
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
If you use the mod (remainder) function you can do what you want.
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Originally posted by Paul Hobson:
I have a some numbers, all of them ranging from 1-100. Is there a code to look at only the number in the one's place. like for the number 96; make it only look at the number six. like i want to make a variable equal to whatever number is in the one's place. if anyone knows how to do this it would be greatly appreciated.

Looks like a home work!
Here is a hint: Use Modulo Division


Mani
Quaerendo Invenietis
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to look at only at the number in the "ones" digit place