• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

displaying a minus dollar amount

Explorer ,
Jun 01, 2006 Jun 01, 2006

Copy link to clipboard

Copied

I set the price field as money data type on ms sql 2k server but I want to display a money value with a dollar sign as an output.
i think i only need to insert into database w/o dollar sign when I pass a form value into database. how can i handle this situation?
TOPICS
Advanced techniques

Views

281

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 01, 2006 Jun 01, 2006
If it were my database, I would use a numeric datatype for my price. I don't know how mssql works, but if you can't do math with a money datatype, you have a limitation. To display the price, I would do something like this:

<cfoutput>
$#price#

Votes

Translate

Translate
LEGEND ,
Jun 01, 2006 Jun 01, 2006

Copy link to clipboard

Copied

If it were my database, I would use a numeric datatype for my price. I don't know how mssql works, but if you can't do math with a money datatype, you have a limitation. To display the price, I would do something like this:

<cfoutput>
$#price#

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2006 Jun 03, 2006

Copy link to clipboard

Copied

LATEST
Use numeric value in database instead of currency

2) then on output use:

#dollarformat(price)#

there are a couple of other options i believe

#dollarformat(price,$_______.__)#

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation