What is going wrong with round?? It works very well for me.

If you want to format afterwards, just use numberformat. What I also do
is use decimalformat and trim the trailing .xx .

So: ListFirst(DecimalFormat(Round(number)),".")

Pascal

> -----Original Message-----
> From: Mark Henderson [mailto:[EMAIL PROTECTED]
> Sent: 06 August 2004 00:24
> To: CF-Talk
> Subject: Rounding number format to 0 decimal places
>
> Moving on from where I left off the other day, I would now like to be
able
> to round the following output to zero decimal places.
>
> Here's my query
> =====================================
> <cfquery name = "results" datasource = "#request.dsn#">
>     SELECT *
>     FROM results
>     WHERE team_name IS NOT NULL
>     ORDER BY total_score DESC
> </cfquery>
>
>
> And the resulting output.
> =====================================
>   <cfoutput query="results">
>   <tr bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('eeeeee'))#">
>     <td>#team_name#</td>
>
<td>#results["wins_round_#round_number_results#"][currentRow]#)</td>
>
<td>#results["margin_round_#round_number_results#"][currentRow]#</td>
>     <td>#total_wins#</td>
>     <td>#total_margins#</td>
>     <td>#total_score#</td>
>   </tr>
>   </cfoutput>
>
>
> All resulting output apart from the team_name is in number format
(that's
> how it's set up in the database, and I know I could just change it to
text
> and this would fix my problem, however I don't think it's an ideal
> solution).
>
> So I'd like to round columns 2 and 3 to zero decimal places. I've
> investigated the round property without much luck.
>
> I'm sure this isn't too complicated....Any ideas?
>
> TIA
> Regards
> Mark Henderson
> Web Designer
> mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to