[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

How can i remove $ sign from this code :<cfoutput>#DollarFormat(TotPrice)#</cfoutput> ?

Hello all

Please let me know that how cai i remove  $ sign from this code :<cfoutput>#DollarFormat(TotPrice)#</cfoutput> ?

Thanks
mostaghassi
0
MOSTAGHASSI
Asked:
MOSTAGHASSI
  • 3
  • 3
  • 2
  • +2
2 Solutions
 
pinaldaveCommented:
you can NOT!
User alternate methods like
<cfoutput>#NumberFormat(TotPrice,"999.99")#</cfoutput>

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa48.htm#wp1110053

Regards,
---Pinal
0
 
James RodgersWeb Applications DeveloperCommented:
change it to decimalFormat

<cfoutput>#decimalFormat(TotPrice)#</cfoutput>
0
 
adonis1976Commented:
good one pinal..
0
Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

 
James RodgersWeb Applications DeveloperCommented:
sorry - was typing when you posted
0
 
pinaldaveCommented:
no problem. We all play together and help each other is the whole motive.
Regards,
--Pinal
0
 
mrichmonCommented:
I was refraining from commenting since the solution of "remove $" is clearly stated, but I couldn't resist adding that depending on what you want to do you may want to consider LSCurrencyFormat function which doesn't add the $, but does add the appropriate symbol to your location.
0
 
pinaldaveCommented:
mrichmon that is good aleternate suggestion.
Regards,
---Pinal
0
 
mrichmonCommented:
Here is the link to documentation showing different output per locale
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000570.htm#132017
0
 
MOSTAGHASSIAuthor Commented:
Thanks for all comments

The solution of :
<cfoutput>#NumberFormat(TotPrice,"999.99")#</cfoutput>

and:
<cfoutput>#decimalFormat(TotPrice)#</cfoutput>

can solve my problem that i want keep only 2 digidts after decimal point but for first solution if i have "25.99" then i will get " 25.99" with a space there will be no problem?

second solution has not space but i would like to know that it keep  digites after decimal point  as the main numer is e.g
if i have 324.987  the output is 324.987?

-mostaghassi
0
 
James RodgersWeb Applications DeveloperCommented:
glad i could help

thanks for the points
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now