ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2004, 05:41 PM
Brutality Brutality is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 24 Brutality User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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 on my page.

<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

Reply With Quote
  #2  
Old August 6th, 2004, 08:24 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
I don't understand, round() *does* round to the nearest whole number, which is 0 decimal places.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old August 8th, 2004, 08:20 PM
Brutality Brutality is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 24 Brutality User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes sorry Kiteless...it was actually another problem causing this issue which has now been resolved.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Rounding Number format to 0 decimal places


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT