Professional Web Applications Themes

numberformat - is optional no longer optional? - Macromedia ColdFusion

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 ...

  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. #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

Similar Threads

  1. Optional Arguments in a CFC
    By Cannikinn in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: June 22nd, 09:16 PM
  2. Optional properties
    By Alex Dinu in forum ASP.NET Web Services
    Replies: 4
    Last Post: December 21st, 04:25 PM
  3. WSDL and Optional Parameters
    By WHY in forum ASP.NET Web Services
    Replies: 16
    Last Post: August 10th, 08:47 AM
  4. preg_match_all optional subpattern
    By Han in forum PHP Development
    Replies: 5
    Last Post: October 7th, 05:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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