coldfusion - How can I always round down to the closest 10 whole number? -
so, have query returns number of records. , on results page display line says: results 1 10 out of 30+ results shown below.
the 30+ number doing this:
<!--- round nearest ten ---> <cfset totalfoundrounded = round(myquery.recordcount/ 10) * 10> this works great if recordcount example 34 or less. or 24 or less, gets on 5, code rounds up. if there 18 records, 20+ records found.
i have been scratching head on how logic work, rounds down nearest 10, if it's 18, or 19.
i tried using int() didn't work, works on decimal places.
so, there function in coldfusion, or technique i'm missing work? have been unable find searching, , math not strong point :(
thank suggestions!!
try this?
<cfset totalfoundrounded = int(myquery.recordcount/ 10) * 10>
Comments
Post a Comment