|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
yes sorry Kiteless...it was actually another problem causing this issue which has now been resolved.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Rounding Number format to 0 decimal places |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|