Creating a function?
View Single Post
02-05-2009, 07:50 PM
La Vida es Sueño
Join Date: Sep 2007
In the most simplest code this could be shown as the following.
function is doing is taking your integer (14) and diving by 10 to give you a float (1.4). The rounding of the numbers, as seen in the
, is necessary merely to limit the number of digits that are displayed subsequent to the decimal point. In the
's example, we are limited to a mere one digit after the decimal point. In my example I don't use any rounding, although if need be we could use
. I have left this out though to keep the example simple.
Although, I do suggest using the
method because it looks better and also you have more control in fewer lines, I hope the code below helps you understand the functionality behind Salathe's solution.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney