I am not sure how to go about creating a function. I have a search script that when returns the result there are 4 specific columns that will have either 11,12,13,14,15 but only one number per column. Order depends on how they enter them in (ex. col_1 = 13, col_2 = 11, col_3 = 15, col_4 = 12 OR col_1 = 11, col_2 = 15, col_3 = 13, col_4 = 12 and so on). Each of the numbers needs to be have a decimal added in the middle (ex. 11 = 1.1, 12 = 1.2 and so on). This is what I have happening right now.
In the most simplest code this could be shown as the following.
All the sprintf 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 sprintf, is necessary merely to limit the number of digits that are displayed subsequent to the decimal point. In the sprintf'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 round. I have left this out though to keep the example simple.
Although, I do suggest using the sprintf 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.