Skip to main content
Inspiring
December 1, 2008
Question

Dollar amounts and decimal places

  • December 1, 2008
  • 1 reply
  • 316 views
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. ?
    This topic has been closed for replies.

    1 reply

    Inspiring
    December 1, 2008
    numberformat(unitvalue, "9.99")