numberformat - is optional no longer optional?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default numberformat - is optional no longer optional?

    Hey all, we just switched to mx. mx 7 is on our horizon, but not close enough
    for me. I have a problem with numberformat that i did not have on cf5. When i
    apply the optional (9 or _) formatting after a decimal place it is forcing 0.
    Now, it used to truly be optional. However now it's apparently only optional
    if it's to the left of the decimal place. Is there a work-around? EXAMPLES
    #numberFormat(999.99, '999,999.9999')#<br /> #numberFormat(9999.99,
    '999,999.0999')#<br /> return the following 999.9900 9,999.9900 other options
    i tried include: #numberFormat(999.99, '999,999.____')#<br /> and
    #numberFormat(99.9900)#<br /> every single one of them has the trailing 0. my
    final goal is to have a) a database value of 9999.900 appear as 9,999.9 as
    well as b) NOT to have 99.997 appear as 99.9970. If i can reach the second
    goal (b) i will not worry about the first so much. Is there a workaround for
    these so-called optional digit place holders when they are refusing to be
    optional? Thanks

    miki Guest

  2. Similar Questions and Discussions

    1. Optional Arguments in a CFC
      Let's say I have the following function in a CFC: <cffunction name="init" access="public" output="false"> <cfargument name="id" type="numeric"...
    2. Optional properties
      If you have a data class, Person, with two properties, FirstName and LastName, and at a later stage you want to add a new optional property to the...
    3. WSDL and Optional Parameters
      Since there's no way to create a c# method with optional, or nullable parameters. And since you can't write an overloaded web method. Is it...
    4. Optional Parameters ASP to SQL stored procedure
      Hi there, Can someone help, this is driving me crazy I have written a stored procedure in sql with input, output and return parameters. This...
    5. preg_match_all optional subpattern
      Using preg_match_all, I need to capture a list of first and last names plus an optional country code proceeding them. For example: ...
  3. #2

    Default Re: numberformat - is optional no longer optional?

    As I remember, Numberformat() has always acted like this. Whether you use "9"
    or "0"
    on the right side of the decimal, it will always display the number of
    formatting characters.
    The reason for this is the decimal portion of numbers are not padding, but a
    part of the
    number. Take 1.120045 , for example. If you numberformat() it with "00.999"
    it will display
    01.120 because the left side 0 is padding, the right side 0 is not..

    OldCFer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139