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

Dollar amounts and decimal places

Participant ,
Dec 01, 2008 Dec 01, 2008
I have a column name unitValue, datatype float, lenght 8, in a table on sql server. The user has to enter numeric value and 2 place decimal to pass validation. The data is stored as 2.99, etc.

When I cfoutput to display, I use dollarformat to get the dollar sign. So far so good.

Here is my problem/question.

When I display in a form field for edit, <cfinput type="text" name="unitvalue" value="q#ry.unitvalue#">, it will display as 2.99, 1 (for 1.00), or 1.1 (for 1.10), leaving off the zeros.

How do I get it to display the full 2 decimals, 2.99, 1.00, 1.10, including all zeros, etc. ?
285
Translate
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
Explorer ,
Dec 01, 2008 Dec 01, 2008
LATEST
numberformat(unitvalue, "9.99")
Translate
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