This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi, Thank You all for the help that you give. I have a variable that I will call OccourancePerLine. This value is calculated as a double. 1 / How can I truncate it to a integer? ie OccourancePerLine = 5.6 I want IntOccourancePerLine = 5 2 / How can I get the value rounded to an Integer? ie OccourancePerLine = 5.6 I want IntOccourancePerLine = 6
OccurancePerLine sounds familiar... you can also calculate the value as an int from the start: int occurancePerLine = someString.length % lineLength; that will give you the whole number integer value that relates to how many times the "string" will fit on the line. [This message has been edited by Greg Harris (edited May 04, 2001).]