Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
ColdFusion
Discussions
Formating to Percent
Home
ColdFusion
Discussions
Formating to Percent
0
Upvote
Formating to Percent
Newsgroup_User
LEGEND
,
/t5/coldfusion-discussions/formating-to-percent/td-p/443537
Oct 06, 2007
Oct 06, 2007
Copy link to clipboard
Copied
I have a variable that is a long 0.1243453235 and I want to render it to a
percent. What function do I need to use?
And the darnest things is that I know this and cannot remember. :-)
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126
TOPICS
Advanced techniques
Views
282
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
4 Replies
4
Jump to latest reply
riffraff-2O2uHw
New Here
,
/t5/coldfusion-discussions/formating-to-percent/m-p/443538#M39994
Oct 06, 2007
Oct 06, 2007
Copy link to clipboard
Copied
I use this:
<cfset teampercent=(spadesalt.win/spadesalt.total_games)*100>
then output
#numberformat(teampercent,"999.99")# %
But this is of course contingent upon what you are basing your percentage on
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/coldfusion-discussions/formating-to-percent/m-p/443539#M39995
Oct 06, 2007
Oct 06, 2007
Copy link to clipboard
Copied
That's close, but not exactly. I am getting:
Single Women 0.26%
How can I get it down to just 26%
The original number is: 0.26125513326308364
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
riffraff-2O2uHw
New Here
,
/t5/coldfusion-discussions/formating-to-percent/m-p/443540#M39996
Oct 06, 2007
Oct 06, 2007
Copy link to clipboard
Copied
In Response To Newsgroup_User
multiple results by 100 in a cfset statement
<cfset singlewomen=yourvar*100>
<cfoutput>#numberformat(singlewomen,"999")# %<cfoutput>
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
BKBK
Community Expert
,
/t5/coldfusion-discussions/formating-to-percent/m-p/443541#M39997
Oct 06, 2007
Oct 06, 2007
Copy link to clipboard
Copied
LATEST
<p>
<cfset x=0.26125513326308364>
<cfset xAsPercent = 100 * x>
x = <cfoutput>#x#</cfoutput><br>
x as percent = <cfoutput>#round(xAsPercent)#%</cfoutput><br>
</p>
<p>
<cfset y=0.26525513326308364>
<cfset yAsPercent = 100 * y>
y = <cfoutput>#y#</cfoutput><br>
y as percent = <cfoutput>#round(yAsPercent)#%</cfoutput>
</p>
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Documentation
ColdFusion User Guide